| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |