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

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

Issue 333713005: Move event stuff of web_view.js to its own class/file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from fady 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
« no previous file with comments | « no previous file | chrome/chrome_renderer.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 if (!attached()) { 251 if (!attached()) {
252 pending_events_.push_back(linked_ptr<Event>(event_ptr.release())); 252 pending_events_.push_back(linked_ptr<Event>(event_ptr.release()));
253 return; 253 return;
254 } 254 }
255 255
256 Profile* profile = Profile::FromBrowserContext(browser_context_); 256 Profile* profile = Profile::FromBrowserContext(browser_context_);
257 257
258 extensions::EventFilteringInfo info; 258 extensions::EventFilteringInfo info;
259 info.SetInstanceID(guest_instance_id_); 259 info.SetInstanceID(view_instance_id_);
260 scoped_ptr<base::ListValue> args(new base::ListValue()); 260 scoped_ptr<base::ListValue> args(new base::ListValue());
261 args->Append(event->GetArguments().release()); 261 args->Append(event->GetArguments().release());
262 262
263 extensions::EventRouter::DispatchEvent( 263 extensions::EventRouter::DispatchEvent(
264 embedder_web_contents_, 264 embedder_web_contents_,
265 profile, 265 profile,
266 embedder_extension_id_, 266 embedder_extension_id_,
267 event->name(), 267 event->name(),
268 args.Pass(), 268 args.Pass(),
269 extensions::EventRouter::USER_GESTURE_UNKNOWN, 269 extensions::EventRouter::USER_GESTURE_UNKNOWN,
270 info); 270 info);
271 } 271 }
272 272
273 void GuestViewBase::SendQueuedEvents() { 273 void GuestViewBase::SendQueuedEvents() {
274 if (!attached()) 274 if (!attached())
275 return; 275 return;
276 while (!pending_events_.empty()) { 276 while (!pending_events_.empty()) {
277 linked_ptr<Event> event_ptr = pending_events_.front(); 277 linked_ptr<Event> event_ptr = pending_events_.front();
278 pending_events_.pop_front(); 278 pending_events_.pop_front();
279 DispatchEvent(event_ptr.release()); 279 DispatchEvent(event_ptr.release());
280 } 280 }
281 } 281 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698