OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, | 133 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, |
134 RenderViewHostDelegate* delegate, | 134 RenderViewHostDelegate* delegate, |
135 int routing_id, | 135 int routing_id, |
136 bool swapped_out, | 136 bool swapped_out, |
137 SessionStorageNamespace* session_storage) | 137 SessionStorageNamespace* session_storage) |
138 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), | 138 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), |
139 delegate_(delegate), | 139 delegate_(delegate), |
140 instance_(static_cast<SiteInstanceImpl*>(instance)), | 140 instance_(static_cast<SiteInstanceImpl*>(instance)), |
141 waiting_for_drag_context_response_(false), | 141 waiting_for_drag_context_response_(false), |
142 enabled_bindings_(0), | 142 enabled_bindings_(0), |
143 guest_(false), | |
144 pending_request_id_(-1), | 143 pending_request_id_(-1), |
145 navigations_suspended_(false), | 144 navigations_suspended_(false), |
146 suspended_nav_message_(NULL), | 145 suspended_nav_message_(NULL), |
147 is_swapped_out_(swapped_out), | 146 is_swapped_out_(swapped_out), |
148 run_modal_reply_msg_(NULL), | 147 run_modal_reply_msg_(NULL), |
149 is_waiting_for_beforeunload_ack_(false), | 148 is_waiting_for_beforeunload_ack_(false), |
150 is_waiting_for_unload_ack_(false), | 149 is_waiting_for_unload_ack_(false), |
151 unload_ack_is_for_cross_site_transition_(false), | 150 unload_ack_is_for_cross_site_transition_(false), |
152 are_javascript_messages_suppressed_(false), | 151 are_javascript_messages_suppressed_(false), |
153 sudden_termination_allowed_(false), | 152 sudden_termination_allowed_(false), |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 content::RenderViewHostDelegate* RenderViewHostImpl::GetDelegate() const { | 196 content::RenderViewHostDelegate* RenderViewHostImpl::GetDelegate() const { |
198 return delegate_; | 197 return delegate_; |
199 } | 198 } |
200 | 199 |
201 content::SiteInstance* RenderViewHostImpl::GetSiteInstance() const { | 200 content::SiteInstance* RenderViewHostImpl::GetSiteInstance() const { |
202 return instance_; | 201 return instance_; |
203 } | 202 } |
204 | 203 |
205 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name, | 204 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name, |
206 int opener_route_id, | 205 int opener_route_id, |
207 int32 max_page_id) { | 206 int32 max_page_id, |
| 207 int embedder_process_id, |
| 208 int embedder_routing_id) { |
208 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 209 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
209 | 210 |
210 // The process may (if we're sharing a process with another host that already | 211 // The process may (if we're sharing a process with another host that already |
211 // initialized it) or may not (we have our own process or the old process | 212 // initialized it) or may not (we have our own process or the old process |
212 // crashed) have been initialized. Calling Init multiple times will be | 213 // crashed) have been initialized. Calling Init multiple times will be |
213 // ignored, so this is safe. | 214 // ignored, so this is safe. |
214 if (!GetProcess()->Init()) | 215 if (!GetProcess()->Init()) |
215 return false; | 216 return false; |
216 DCHECK(GetProcess()->HasConnection()); | 217 DCHECK(GetProcess()->HasConnection()); |
217 DCHECK(GetProcess()->GetBrowserContext()); | 218 DCHECK(GetProcess()->GetBrowserContext()); |
(...skipping 28 matching lines...) Expand all Loading... |
246 GetView())->GetScreenInfo(¶ms.screen_info); | 247 GetView())->GetScreenInfo(¶ms.screen_info); |
247 } else { | 248 } else { |
248 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 249 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
249 ¶ms.screen_info); | 250 ¶ms.screen_info); |
250 } | 251 } |
251 #else | 252 #else |
252 params.screen_info = | 253 params.screen_info = |
253 WebKit::WebScreenInfoFactory::screenInfo( | 254 WebKit::WebScreenInfoFactory::screenInfo( |
254 gfx::NativeViewFromId(GetNativeViewId())); | 255 gfx::NativeViewFromId(GetNativeViewId())); |
255 #endif | 256 #endif |
256 params.guest = guest_; | 257 params.embedder_process_id = embedder_process_id; |
| 258 params.embedder_routing_id = embedder_routing_id; |
257 params.accessibility_mode = | 259 params.accessibility_mode = |
258 BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser() ? | 260 BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser() ? |
259 AccessibilityModeComplete : | 261 AccessibilityModeComplete : |
260 AccessibilityModeOff; | 262 AccessibilityModeOff; |
261 | 263 |
262 #if defined(OS_WIN) | 264 #if defined(OS_WIN) |
263 // On Windows 8, always enable accessibility for editable text controls | 265 // On Windows 8, always enable accessibility for editable text controls |
264 // so we can show the virtual keyboard when one is enabled. | 266 // so we can show the virtual keyboard when one is enabled. |
265 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 267 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
266 params.accessibility_mode == AccessibilityModeOff) { | 268 params.accessibility_mode == AccessibilityModeOff) { |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 // can cause navigations to be ignored in OnMsgNavigate. | 1805 // can cause navigations to be ignored in OnMsgNavigate. |
1804 is_waiting_for_beforeunload_ack_ = false; | 1806 is_waiting_for_beforeunload_ack_ = false; |
1805 is_waiting_for_unload_ack_ = false; | 1807 is_waiting_for_unload_ack_ = false; |
1806 } | 1808 } |
1807 | 1809 |
1808 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1810 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
1809 STLDeleteValues(&power_save_blockers_); | 1811 STLDeleteValues(&power_save_blockers_); |
1810 } | 1812 } |
1811 | 1813 |
1812 } // namespace content | 1814 } // namespace content |
OLD | NEW |