| 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 "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/guest_view/guest_view_manager.h" | 9 #include "chrome/browser/guest_view/guest_view_manager.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 return event.type == blink::WebGestureEvent::GesturePinchBegin || | 385 return event.type == blink::WebGestureEvent::GesturePinchBegin || |
| 386 event.type == blink::WebGestureEvent::GesturePinchUpdate || | 386 event.type == blink::WebGestureEvent::GesturePinchUpdate || |
| 387 event.type == blink::WebGestureEvent::GesturePinchEnd; | 387 event.type == blink::WebGestureEvent::GesturePinchEnd; |
| 388 } | 388 } |
| 389 | 389 |
| 390 GuestViewBase::~GuestViewBase() { | 390 GuestViewBase::~GuestViewBase() { |
| 391 } | 391 } |
| 392 | 392 |
| 393 void GuestViewBase::DispatchEventToEmbedder(Event* event) { | 393 void GuestViewBase::DispatchEventToEmbedder(Event* event) { |
| 394 scoped_ptr<Event> event_ptr(event); | 394 scoped_ptr<Event> event_ptr(event); |
| 395 if (!in_extension()) { | |
| 396 NOTREACHED(); | |
| 397 return; | |
| 398 } | |
| 399 | 395 |
| 400 if (!attached()) { | 396 if (!attached()) { |
| 401 pending_events_.push_back(linked_ptr<Event>(event_ptr.release())); | 397 pending_events_.push_back(linked_ptr<Event>(event_ptr.release())); |
| 402 return; | 398 return; |
| 403 } | 399 } |
| 404 | 400 |
| 405 extensions::EventFilteringInfo info; | 401 extensions::EventFilteringInfo info; |
| 406 info.SetInstanceID(view_instance_id_); | 402 info.SetInstanceID(view_instance_id_); |
| 407 scoped_ptr<base::ListValue> args(new base::ListValue()); | 403 scoped_ptr<base::ListValue> args(new base::ListValue()); |
| 408 args->Append(event->GetArguments().release()); | 404 args->Append(event->GetArguments().release()); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 InitWithWebContents(embedder_extension_id, | 437 InitWithWebContents(embedder_extension_id, |
| 442 embedder_render_process_id, | 438 embedder_render_process_id, |
| 443 guest_web_contents); | 439 guest_web_contents); |
| 444 callback.Run(guest_web_contents); | 440 callback.Run(guest_web_contents); |
| 445 } | 441 } |
| 446 | 442 |
| 447 // static | 443 // static |
| 448 void GuestViewBase::RegisterGuestViewTypes() { | 444 void GuestViewBase::RegisterGuestViewTypes() { |
| 449 extensions::ExtensionsAPIClient::Get()->RegisterGuestViewTypes(); | 445 extensions::ExtensionsAPIClient::Get()->RegisterGuestViewTypes(); |
| 450 } | 446 } |
| OLD | NEW |