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

Side by Side Diff: chrome/browser/guest_view/guest_view_base.cc

Issue 307543005: Fix the Declarative WebRequest API for <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_webcontentsdelegate_impl_to_chrome
Patch Set: Fix WebRequest unit tests Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/guest_view/guest_view_base.h" 5 #include "chrome/browser/guest_view/guest_view_base.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h" 8 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h"
9 #include "chrome/browser/guest_view/guest_view_constants.h" 9 #include "chrome/browser/guest_view/guest_view_constants.h"
10 #include "chrome/browser/guest_view/guest_view_manager.h" 10 #include "chrome/browser/guest_view/guest_view_manager.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 if (!attached()) { 229 if (!attached()) {
230 pending_events_.push_back(linked_ptr<Event>(event_ptr.release())); 230 pending_events_.push_back(linked_ptr<Event>(event_ptr.release()));
231 return; 231 return;
232 } 232 }
233 233
234 Profile* profile = Profile::FromBrowserContext(browser_context_); 234 Profile* profile = Profile::FromBrowserContext(browser_context_);
235 235
236 extensions::EventFilteringInfo info; 236 extensions::EventFilteringInfo info;
237 info.SetURL(GURL());
238 info.SetInstanceID(guest_instance_id_); 237 info.SetInstanceID(guest_instance_id_);
239 scoped_ptr<base::ListValue> args(new base::ListValue()); 238 scoped_ptr<base::ListValue> args(new base::ListValue());
240 args->Append(event->GetArguments().release()); 239 args->Append(event->GetArguments().release());
241 240
242 extensions::EventRouter::DispatchEvent( 241 extensions::EventRouter::DispatchEvent(
243 embedder_web_contents_, 242 embedder_web_contents_,
244 profile, 243 profile,
245 embedder_extension_id_, 244 embedder_extension_id_,
246 event->name(), 245 event->name(),
247 args.Pass(), 246 args.Pass(),
248 extensions::EventRouter::USER_GESTURE_UNKNOWN, 247 extensions::EventRouter::USER_GESTURE_UNKNOWN,
249 info); 248 info);
250 } 249 }
251 250
252 void GuestViewBase::SendQueuedEvents() { 251 void GuestViewBase::SendQueuedEvents() {
253 if (!attached()) 252 if (!attached())
254 return; 253 return;
255 while (!pending_events_.empty()) { 254 while (!pending_events_.empty()) {
256 linked_ptr<Event> event_ptr = pending_events_.front(); 255 linked_ptr<Event> event_ptr = pending_events_.front();
257 pending_events_.pop_front(); 256 pending_events_.pop_front();
258 DispatchEvent(event_ptr.release()); 257 DispatchEvent(event_ptr.release());
259 } 258 }
260 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/guest_view.h ('k') | chrome/browser/guest_view/web_view/web_view_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698