summaryrefslogtreecommitdiff
path: root/riscos/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'riscos/search.c')
-rw-r--r--riscos/search.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/riscos/search.c b/riscos/search.c
index 23c148028..bf070a965 100644
--- a/riscos/search.c
+++ b/riscos/search.c
@@ -32,7 +32,7 @@
#include "content/hlcache.h"
#include "desktop/browser.h"
#include "desktop/gui.h"
-#include "desktop/browser_private.h"
+#include "desktop/browser.h"
#include "desktop/search.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -259,22 +259,33 @@ bool ro_gui_search_prepare_menu(void)
return true;
}
-/**
- * Open the search dialog
- *
- * \param bw the browser window to search
- */
-void ro_gui_search_prepare(struct browser_window *bw)
+bool ro_gui_search_bw_searchable(struct browser_window *bw)
{
hlcache_handle *h;
assert(bw != NULL);
- h = bw->current_content;
+ h = browser_window_get_content(bw);
/* only handle html/textplain contents */
+ /* TODO: Should have content_is_searchable() api */
if ((!h) || (content_get_type(h) != CONTENT_HTML &&
content_get_type(h) != CONTENT_TEXTPLAIN))
+ return false;
+
+ return true;
+}
+
+
+/**
+ * Open the search dialog
+ *
+ * \param bw the browser window to search
+ */
+void ro_gui_search_prepare(struct browser_window *bw)
+{
+ /* only handle searchable contents */
+ if (!ro_gui_search_bw_searchable(bw))
return;
/* if the search dialogue is reopened over a new window, we may