Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 2808923003: Revert of Enable find-in-page across GuestViews. (Closed)
Patch Set: Fixed patch conflicts. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
6 6
7 #include "content/browser/browser_plugin/browser_plugin_guest.h" 7 #include "content/browser/browser_plugin/browser_plugin_guest.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/common/browser_plugin/browser_plugin_messages.h" 10 #include "content/common/browser_plugin/browser_plugin_messages.h"
11 #include "content/common/drag_messages.h" 11 #include "content/common/drag_messages.h"
12 #include "content/public/browser/browser_context.h" 12 #include "content/public/browser/browser_context.h"
13 #include "content/public/browser/browser_plugin_guest_manager.h" 13 #include "content/public/browser/browser_plugin_guest_manager.h"
14 #include "content/public/browser/native_web_keyboard_event.h" 14 #include "content/public/browser/native_web_keyboard_event.h"
15 #include "content/public/browser/render_view_host.h" 15 #include "content/public/browser/render_view_host.h"
16 #include "third_party/WebKit/public/web/WebFindOptions.h"
16 #include "ui/events/keycodes/keyboard_codes.h" 17 #include "ui/events/keycodes/keyboard_codes.h"
17 18
18 namespace content { 19 namespace content {
19 20
20 BrowserPluginEmbedder::BrowserPluginEmbedder(WebContentsImpl* web_contents) 21 BrowserPluginEmbedder::BrowserPluginEmbedder(WebContentsImpl* web_contents)
21 : WebContentsObserver(web_contents), 22 : WebContentsObserver(web_contents),
22 guest_drag_ending_(false), 23 guest_drag_ending_(false),
23 weak_ptr_factory_(this) { 24 weak_ptr_factory_(this) {
24 } 25 }
25 26
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 180
180 bool event_consumed = false; 181 bool event_consumed = false;
181 GetBrowserPluginGuestManager()->ForEachGuest( 182 GetBrowserPluginGuestManager()->ForEachGuest(
182 web_contents(), 183 web_contents(),
183 base::Bind(&BrowserPluginEmbedder::UnlockMouseIfNecessaryCallback, 184 base::Bind(&BrowserPluginEmbedder::UnlockMouseIfNecessaryCallback,
184 &event_consumed)); 185 &event_consumed));
185 186
186 return event_consumed; 187 return event_consumed;
187 } 188 }
188 189
190 bool BrowserPluginEmbedder::Find(int request_id,
191 const base::string16& search_text,
192 const blink::WebFindOptions& options) {
193 return GetBrowserPluginGuestManager()->ForEachGuest(
194 web_contents(),
195 base::Bind(&BrowserPluginEmbedder::FindInGuest,
196 request_id,
197 search_text,
198 options));
199 }
200
201 bool BrowserPluginEmbedder::StopFinding(StopFindAction action) {
202 return GetBrowserPluginGuestManager()->ForEachGuest(
203 web_contents(),
204 base::Bind(&BrowserPluginEmbedder::StopFindingInGuest, action));
205 }
206
189 BrowserPluginGuest* BrowserPluginEmbedder::GetFullPageGuest() { 207 BrowserPluginGuest* BrowserPluginEmbedder::GetFullPageGuest() {
190 WebContentsImpl* guest_contents = static_cast<WebContentsImpl*>( 208 WebContentsImpl* guest_contents = static_cast<WebContentsImpl*>(
191 GetBrowserPluginGuestManager()->GetFullPageGuest(web_contents())); 209 GetBrowserPluginGuestManager()->GetFullPageGuest(web_contents()));
192 if (!guest_contents) 210 if (!guest_contents)
193 return nullptr; 211 return nullptr;
194 return guest_contents->GetBrowserPluginGuest(); 212 return guest_contents->GetBrowserPluginGuest();
195 } 213 }
196 214
197 // static 215 // static
198 bool BrowserPluginEmbedder::GuestRecentlyAudibleCallback(WebContents* guest) { 216 bool BrowserPluginEmbedder::GuestRecentlyAudibleCallback(WebContents* guest) {
(...skipping 11 matching lines...) Expand all
210 WebContents* guest) { 228 WebContents* guest) {
211 *mouse_unlocked |= static_cast<WebContentsImpl*>(guest) 229 *mouse_unlocked |= static_cast<WebContentsImpl*>(guest)
212 ->GetBrowserPluginGuest() 230 ->GetBrowserPluginGuest()
213 ->mouse_locked(); 231 ->mouse_locked();
214 guest->GotResponseToLockMouseRequest(false); 232 guest->GotResponseToLockMouseRequest(false);
215 233
216 // Returns false to iterate over all guests. 234 // Returns false to iterate over all guests.
217 return false; 235 return false;
218 } 236 }
219 237
238 // static
239 bool BrowserPluginEmbedder::FindInGuest(int request_id,
240 const base::string16& search_text,
241 const blink::WebFindOptions& options,
242 WebContents* guest) {
243 if (static_cast<WebContentsImpl*>(guest)
244 ->GetBrowserPluginGuest()
245 ->HandleFindForEmbedder(request_id, search_text, options)) {
246 // There can only ever currently be one browser plugin that handles find so
247 // we can break the iteration at this point.
248 return true;
249 }
250 return false;
251 }
252
253 // static
254 bool BrowserPluginEmbedder::StopFindingInGuest(StopFindAction action,
255 WebContents* guest) {
256 if (static_cast<WebContentsImpl*>(guest)
257 ->GetBrowserPluginGuest()
258 ->HandleStopFindingForEmbedder(action)) {
259 // There can only ever currently be one browser plugin that handles find so
260 // we can break the iteration at this point.
261 return true;
262 }
263 return false;
264 }
265
220 } // namespace content 266 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_embedder.h ('k') | content/browser/browser_plugin/browser_plugin_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698