| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } | 198 } |
| 199 | 199 |
| 200 content::RenderViewHostDelegate* RenderViewHostImpl::GetDelegate() const { | 200 content::RenderViewHostDelegate* RenderViewHostImpl::GetDelegate() const { |
| 201 return delegate_; | 201 return delegate_; |
| 202 } | 202 } |
| 203 | 203 |
| 204 content::SiteInstance* RenderViewHostImpl::GetSiteInstance() const { | 204 content::SiteInstance* RenderViewHostImpl::GetSiteInstance() const { |
| 205 return instance_; | 205 return instance_; |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name, | 208 bool RenderViewHostImpl::CreateRenderView( |
| 209 int opener_route_id, | 209 const string16& frame_name, |
| 210 int32 max_page_id, | 210 int opener_route_id, |
| 211 int embedder_process_id) { | 211 int32 max_page_id, |
| 212 const std::string& embedder_channel_name, |
| 213 int embedder_container_id) { |
| 212 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 214 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
| 213 | 215 |
| 214 // The process may (if we're sharing a process with another host that already | 216 // The process may (if we're sharing a process with another host that already |
| 215 // initialized it) or may not (we have our own process or the old process | 217 // initialized it) or may not (we have our own process or the old process |
| 216 // crashed) have been initialized. Calling Init multiple times will be | 218 // crashed) have been initialized. Calling Init multiple times will be |
| 217 // ignored, so this is safe. | 219 // ignored, so this is safe. |
| 218 if (!GetProcess()->Init()) | 220 if (!GetProcess()->Init()) |
| 219 return false; | 221 return false; |
| 220 DCHECK(GetProcess()->HasConnection()); | 222 DCHECK(GetProcess()->HasConnection()); |
| 221 DCHECK(GetProcess()->GetBrowserContext()); | 223 DCHECK(GetProcess()->GetBrowserContext()); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 250 GetView())->GetScreenInfo(¶ms.screen_info); | 252 GetView())->GetScreenInfo(¶ms.screen_info); |
| 251 } else { | 253 } else { |
| 252 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 254 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 253 ¶ms.screen_info); | 255 ¶ms.screen_info); |
| 254 } | 256 } |
| 255 #else | 257 #else |
| 256 params.screen_info = | 258 params.screen_info = |
| 257 WebKit::WebScreenInfoFactory::screenInfo( | 259 WebKit::WebScreenInfoFactory::screenInfo( |
| 258 gfx::NativeViewFromId(GetNativeViewId())); | 260 gfx::NativeViewFromId(GetNativeViewId())); |
| 259 #endif | 261 #endif |
| 260 | 262 params.embedder_channel_name = embedder_channel_name; |
| 261 if (embedder_process_id != -1) { | 263 params.embedder_container_id = embedder_container_id; |
| 262 params.embedder_channel_name = | |
| 263 StringPrintf("%d.r%d", GetProcess()->GetID(), embedder_process_id); | |
| 264 } | |
| 265 | |
| 266 params.accessibility_mode = | 264 params.accessibility_mode = |
| 267 BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser() ? | 265 BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser() ? |
| 268 AccessibilityModeComplete : | 266 AccessibilityModeComplete : |
| 269 AccessibilityModeOff; | 267 AccessibilityModeOff; |
| 270 | 268 |
| 271 #if defined(OS_WIN) | 269 #if defined(OS_WIN) |
| 272 // On Windows 8, always enable accessibility for editable text controls | 270 // On Windows 8, always enable accessibility for editable text controls |
| 273 // so we can show the virtual keyboard when one is enabled. | 271 // so we can show the virtual keyboard when one is enabled. |
| 274 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 272 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
| 275 params.accessibility_mode == AccessibilityModeOff) { | 273 params.accessibility_mode == AccessibilityModeOff) { |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1841 // can cause navigations to be ignored in OnMsgNavigate. | 1839 // can cause navigations to be ignored in OnMsgNavigate. |
| 1842 is_waiting_for_beforeunload_ack_ = false; | 1840 is_waiting_for_beforeunload_ack_ = false; |
| 1843 is_waiting_for_unload_ack_ = false; | 1841 is_waiting_for_unload_ack_ = false; |
| 1844 } | 1842 } |
| 1845 | 1843 |
| 1846 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1844 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1847 STLDeleteValues(&power_save_blockers_); | 1845 STLDeleteValues(&power_save_blockers_); |
| 1848 } | 1846 } |
| 1849 | 1847 |
| 1850 } // namespace content | 1848 } // namespace content |
| OLD | NEW |