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

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

Issue 1161483004: Move guest view container message routing out of content/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix newwindow Created 5 years, 6 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 "components/guest_view/renderer/guest_view_container.h" 5 #include "components/guest_view/renderer/guest_view_container.h"
6 6
7 #include "components/guest_view/common/guest_view_constants.h" 7 #include "components/guest_view/common/guest_view_constants.h"
8 #include "components/guest_view/common/guest_view_messages.h" 8 #include "components/guest_view/common/guest_view_messages.h"
9 #include "components/guest_view/renderer/guest_view_request.h" 9 #include "components/guest_view/renderer/guest_view_request.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 void GuestViewContainer::OnHandleCallback(const IPC::Message& message) { 111 void GuestViewContainer::OnHandleCallback(const IPC::Message& message) {
112 // Handle the callback for the current request with a pending response. 112 // Handle the callback for the current request with a pending response.
113 HandlePendingResponseCallback(message); 113 HandlePendingResponseCallback(message);
114 // Perform the subsequent request if one exists. 114 // Perform the subsequent request if one exists.
115 PerformPendingRequest(); 115 PerformPendingRequest();
116 } 116 }
117 117
118 bool GuestViewContainer::OnMessage(const IPC::Message& message) { 118 bool GuestViewContainer::OnMessage(const IPC::Message& message) {
119 return false;
120 }
121
122 bool GuestViewContainer::OnMessageReceived(const IPC::Message& message) {
123 if (OnMessage(message))
124 return true;
125
126 OnHandleCallback(message); 119 OnHandleCallback(message);
127 return true; 120 return true;
128 } 121 }
129 122
130 void GuestViewContainer::Ready() { 123 void GuestViewContainer::Ready() {
131 ready_ = true; 124 ready_ = true;
132 CHECK(!pending_response_.get()); 125 CHECK(!pending_response_.get());
133 PerformPendingRequest(); 126 PerformPendingRequest();
134 127
135 // Give the derived type an opportunity to perform some actions when the 128 // Give the derived type an opportunity to perform some actions when the
136 // container acquires a geometry. 129 // container acquires a geometry.
137 OnReady(); 130 OnReady();
138 } 131 }
139 132
140 void GuestViewContainer::SetElementInstanceID(int element_instance_id) { 133 void GuestViewContainer::SetElementInstanceID(int element_instance_id) {
141 DCHECK_EQ(element_instance_id_, guest_view::kInstanceIDNone); 134 DCHECK_EQ(element_instance_id_, guest_view::kInstanceIDNone);
142 element_instance_id_ = element_instance_id; 135 element_instance_id_ = element_instance_id;
143 136
144 DCHECK(!g_guest_view_container_map.Get().count(element_instance_id)); 137 DCHECK(!g_guest_view_container_map.Get().count(element_instance_id));
145 g_guest_view_container_map.Get().insert( 138 g_guest_view_container_map.Get().insert(
146 std::make_pair(element_instance_id, this)); 139 std::make_pair(element_instance_id, this));
147 } 140 }
148 141
149 } // namespace guest_view 142 } // namespace guest_view
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698