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

Side by Side Diff: extensions/renderer/guest_view/guest_view_container.cc

Issue 1092853002: GuestView: Decouple extension IPCs from soon-to-be component IPCs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_guest_view_registry_to_guest_view_manager
Patch Set: Updated Created 5 years, 8 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
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 "extensions/renderer/guest_view/guest_view_container.h" 5 #include "extensions/renderer/guest_view/guest_view_container.h"
6 6
7 #include "content/public/renderer/render_frame.h" 7 #include "content/public/renderer/render_frame.h"
8 #include "content/public/renderer/render_frame_observer.h" 8 #include "content/public/renderer/render_frame_observer.h"
9 #include "content/public/renderer/render_view.h" 9 #include "content/public/renderer/render_view.h"
10 #include "extensions/common/guest_view/extensions_guest_view_messages.h"
10 #include "extensions/common/guest_view/guest_view_constants.h" 11 #include "extensions/common/guest_view/guest_view_constants.h"
11 #include "extensions/common/guest_view/guest_view_messages.h" 12 #include "extensions/common/guest_view/guest_view_messages.h"
12 13
13 namespace extensions { 14 namespace extensions {
14 15
15 class GuestViewContainer::RenderFrameLifetimeObserver 16 class GuestViewContainer::RenderFrameLifetimeObserver
16 : public content::RenderFrameObserver { 17 : public content::RenderFrameObserver {
17 public: 18 public:
18 RenderFrameLifetimeObserver(GuestViewContainer* container, 19 RenderFrameLifetimeObserver(GuestViewContainer* container,
19 content::RenderFrame* render_frame); 20 content::RenderFrame* render_frame);
(...skipping 22 matching lines...) Expand all
42 render_frame_(render_frame) { 43 render_frame_(render_frame) {
43 render_frame_lifetime_observer_.reset( 44 render_frame_lifetime_observer_.reset(
44 new RenderFrameLifetimeObserver(this, render_frame_)); 45 new RenderFrameLifetimeObserver(this, render_frame_));
45 } 46 }
46 47
47 GuestViewContainer::~GuestViewContainer() {} 48 GuestViewContainer::~GuestViewContainer() {}
48 49
49 // static. 50 // static.
50 bool GuestViewContainer::HandlesMessage(const IPC::Message& msg) { 51 bool GuestViewContainer::HandlesMessage(const IPC::Message& msg) {
51 switch (msg.type()) { 52 switch (msg.type()) {
52 case GuestViewMsg_CreateMimeHandlerViewGuestACK::ID: 53 case ExtensionsGuestViewMsg_CreateMimeHandlerViewGuestACK::ID:
54 case ExtensionsGuestViewMsg_MimeHandlerViewGuestOnLoadCompleted::ID:
53 case GuestViewMsg_GuestAttached::ID: 55 case GuestViewMsg_GuestAttached::ID:
54 case GuestViewMsg_GuestDetached::ID: 56 case GuestViewMsg_GuestDetached::ID:
55 case GuestViewMsg_MimeHandlerViewGuestOnLoadCompleted::ID:
56 return true; 57 return true;
57 default: 58 default:
58 return false; 59 return false;
59 } 60 }
60 } 61 }
61 62
62 void GuestViewContainer::RenderFrameDestroyed() { 63 void GuestViewContainer::RenderFrameDestroyed() {
63 OnRenderFrameDestroyed(); 64 OnRenderFrameDestroyed();
64 render_frame_ = nullptr; 65 render_frame_ = nullptr;
65 } 66 }
66 67
67 void GuestViewContainer::SetElementInstanceID(int element_instance_id) { 68 void GuestViewContainer::SetElementInstanceID(int element_instance_id) {
68 DCHECK_EQ(element_instance_id_, guestview::kInstanceIDNone); 69 DCHECK_EQ(element_instance_id_, guestview::kInstanceIDNone);
69 element_instance_id_ = element_instance_id; 70 element_instance_id_ = element_instance_id;
70 } 71 }
71 72
72 } // namespace extensions 73 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698