OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "extensions/renderer/guest_view/extensions_iframe_guest_view_container. h" | |
6 | |
7 #include "base/command_line.h" | |
8 #include "components/guest_view/common/guest_view_messages.h" | |
9 #include "content/public/common/content_switches.h" | |
10 #include "content/public/renderer/render_frame.h" | |
11 #include "extensions/common/guest_view/extensions_guest_view_messages.h" | |
12 | |
13 namespace extensions { | |
14 | |
15 ExtensionsIframeGuestViewContainer::ExtensionsIframeGuestViewContainer( | |
Fady Samuel
2015/06/18 04:47:07
Why is this in extensions? It seems like this coul
lazyboy
2015/06/22 19:43:20
Done.
| |
16 content::RenderFrame* render_frame) | |
17 : ExtensionsGuestViewContainer(render_frame), weak_ptr_factory_(this) { | |
18 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | |
19 switches::kSitePerProcess)); | |
20 // There is no BrowserPluginDelegate to wait for. | |
21 ready_ = true; | |
22 } | |
23 | |
24 ExtensionsIframeGuestViewContainer::~ExtensionsIframeGuestViewContainer() { | |
25 } | |
26 | |
27 bool ExtensionsIframeGuestViewContainer::OnMessage( | |
28 const IPC::Message& message) { | |
29 // TODO(lazyboy): Do not send this message in --site-per-process. | |
30 if (message.type() == GuestViewMsg_GuestAttached::ID) | |
31 return true; | |
32 | |
33 if (message.type() != ExtensionsGuestViewMsg_AttachToEmbedderFrame_ACK::ID) | |
34 return false; | |
35 | |
36 OnHandleCallback(message); | |
37 return true; | |
38 } | |
39 | |
40 } // namespace extensions | |
OLD | NEW |