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 "extensions/browser/guest_view/guest_view_base.h" | 5 #include "extensions/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 "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return event.type == blink::WebGestureEvent::GesturePinchBegin || | 390 return event.type == blink::WebGestureEvent::GesturePinchBegin || |
391 event.type == blink::WebGestureEvent::GesturePinchUpdate || | 391 event.type == blink::WebGestureEvent::GesturePinchUpdate || |
392 event.type == blink::WebGestureEvent::GesturePinchEnd; | 392 event.type == blink::WebGestureEvent::GesturePinchEnd; |
393 } | 393 } |
394 | 394 |
395 GuestViewBase::~GuestViewBase() { | 395 GuestViewBase::~GuestViewBase() { |
396 } | 396 } |
397 | 397 |
398 void GuestViewBase::DispatchEventToEmbedder(Event* event) { | 398 void GuestViewBase::DispatchEventToEmbedder(Event* event) { |
399 scoped_ptr<Event> event_ptr(event); | 399 scoped_ptr<Event> event_ptr(event); |
400 if (!in_extension()) { | |
401 NOTREACHED(); | |
402 return; | |
403 } | |
404 | 400 |
405 if (!attached()) { | 401 if (!attached()) { |
406 pending_events_.push_back(linked_ptr<Event>(event_ptr.release())); | 402 pending_events_.push_back(linked_ptr<Event>(event_ptr.release())); |
407 return; | 403 return; |
408 } | 404 } |
409 | 405 |
410 extensions::EventFilteringInfo info; | 406 extensions::EventFilteringInfo info; |
411 info.SetInstanceID(view_instance_id_); | 407 info.SetInstanceID(view_instance_id_); |
412 scoped_ptr<base::ListValue> args(new base::ListValue()); | 408 scoped_ptr<base::ListValue> args(new base::ListValue()); |
413 args->Append(event->GetArguments().release()); | 409 args->Append(event->GetArguments().release()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 guest_web_contents); | 444 guest_web_contents); |
449 callback.Run(guest_web_contents); | 445 callback.Run(guest_web_contents); |
450 } | 446 } |
451 | 447 |
452 // static | 448 // static |
453 void GuestViewBase::RegisterGuestViewTypes() { | 449 void GuestViewBase::RegisterGuestViewTypes() { |
454 extensions::ExtensionsAPIClient::Get()->RegisterGuestViewTypes(); | 450 extensions::ExtensionsAPIClient::Get()->RegisterGuestViewTypes(); |
455 } | 451 } |
456 | 452 |
457 } // namespace extensions | 453 } // namespace extensions |
OLD | NEW |