Index: content/browser/browser_plugin/browser_plugin_embedder.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc |
index bbd690f9ff735d908e03b5e07beb8fbb19e32472..902f2be69ef4169b6bb28b00556b48a2a0eef476 100644 |
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc |
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc |
@@ -22,6 +22,7 @@ |
#include "content/public/common/result_codes.h" |
#include "content/public/common/url_constants.h" |
#include "net/base/escape.h" |
+#include "third_party/WebKit/public/web/WebFindOptions.h" |
#include "ui/events/keycodes/keyboard_codes.h" |
namespace content { |
@@ -162,6 +163,15 @@ bool BrowserPluginEmbedder::HandleKeyboardEvent( |
return event_consumed; |
} |
+bool BrowserPluginEmbedder::Find(int request_id, |
+ const base::string16& search_text, |
+ const blink::WebFindOptions& options) { |
+ return GetBrowserPluginGuestManager()->ForEachGuest( |
+ GetWebContents(), base::Bind( |
+ &BrowserPluginEmbedder::FindInGuest, |
+ base::Unretained(this), request_id, search_text, options)); |
+} |
+ |
bool BrowserPluginEmbedder::UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, |
WebContents* guest) { |
*mouse_unlocked |= static_cast<WebContentsImpl*>(guest) |
@@ -173,4 +183,17 @@ bool BrowserPluginEmbedder::UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, |
return false; |
} |
+bool BrowserPluginEmbedder::FindInGuest(int request_id, |
+ const base::string16& search_text, |
+ const blink::WebFindOptions& options, |
+ WebContents* guest) { |
+ // XXX: Check if |guest| is a top level frame in the browser. How can I find |
+ // this out?? We can check if the embedder WebContents is a top level frame |
+ // but afaik it may have several guests. Is there a away to see if the guest |
+ // is the only guest and it is top level in the sense that it is not embedded |
+ // within a page? |
raymes
2014/09/25 06:59:06
fsamuel@: Do you have any idea whether this is pos
Fady Samuel
2014/09/25 10:41:29
We can probably detect if the BrowserPlugin is in
raymes
2014/09/29 05:01:34
Hmm I'm not exactly sure which part you would like
Fady Samuel
2014/09/29 12:01:34
Yes. The reason I'd do that is so that other Brows
|
+ static_cast<WebContentsImpl*>(guest)->Find(request_id, search_text, options); |
+ return true; |
+} |
+ |
} // namespace content |