| 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.h" | 5 #include "content/browser/renderer_host/render_view_host.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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "content/public/browser/user_metrics.h" | 46 #include "content/public/browser/user_metrics.h" |
| 47 #include "content/public/common/bindings_policy.h" | 47 #include "content/public/common/bindings_policy.h" |
| 48 #include "content/public/common/content_constants.h" | 48 #include "content/public/common/content_constants.h" |
| 49 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
| 50 #include "content/public/common/context_menu_params.h" | 50 #include "content/public/common/context_menu_params.h" |
| 51 #include "content/public/common/result_codes.h" | 51 #include "content/public/common/result_codes.h" |
| 52 #include "content/public/common/url_constants.h" | 52 #include "content/public/common/url_constants.h" |
| 53 #include "net/base/net_util.h" | 53 #include "net/base/net_util.h" |
| 54 #include "net/url_request/url_request_context_getter.h" | 54 #include "net/url_request/url_request_context_getter.h" |
| 55 #include "third_party/skia/include/core/SkBitmap.h" | 55 #include "third_party/skia/include/core/SkBitmap.h" |
| 56 #if defined(OS_WIN) |
| 57 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebScreenInfoFact
ory.h" |
| 58 #endif |
| 56 #include "ui/gfx/native_widget_types.h" | 59 #include "ui/gfx/native_widget_types.h" |
| 57 #include "webkit/fileapi/isolated_context.h" | 60 #include "webkit/fileapi/isolated_context.h" |
| 58 #include "webkit/glue/webaccessibility.h" | 61 #include "webkit/glue/webaccessibility.h" |
| 59 #include "webkit/glue/webdropdata.h" | 62 #include "webkit/glue/webdropdata.h" |
| 60 | 63 |
| 61 using base::TimeDelta; | 64 using base::TimeDelta; |
| 62 using content::BrowserContext; | 65 using content::BrowserContext; |
| 63 using content::BrowserMessageFilter; | 66 using content::BrowserMessageFilter; |
| 64 using content::BrowserThread; | 67 using content::BrowserThread; |
| 65 using content::DomOperationNotificationDetails; | 68 using content::DomOperationNotificationDetails; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 ViewMsg_New_Params params; | 207 ViewMsg_New_Params params; |
| 205 params.parent_window = GetNativeViewId(); | 208 params.parent_window = GetNativeViewId(); |
| 206 params.renderer_preferences = | 209 params.renderer_preferences = |
| 207 delegate_->GetRendererPrefs(process()->GetBrowserContext()); | 210 delegate_->GetRendererPrefs(process()->GetBrowserContext()); |
| 208 params.web_preferences = delegate_->GetWebkitPrefs(); | 211 params.web_preferences = delegate_->GetWebkitPrefs(); |
| 209 params.view_id = routing_id(); | 212 params.view_id = routing_id(); |
| 210 params.surface_id = surface_id(); | 213 params.surface_id = surface_id(); |
| 211 params.session_storage_namespace_id = session_storage_namespace_->id(); | 214 params.session_storage_namespace_id = session_storage_namespace_->id(); |
| 212 params.frame_name = frame_name; | 215 params.frame_name = frame_name; |
| 213 params.next_page_id = next_page_id; | 216 params.next_page_id = next_page_id; |
| 217 #if defined(OS_POSIX) || defined(USE_AURA) |
| 218 if (view()) { |
| 219 static_cast<content::RenderWidgetHostViewPort*>( |
| 220 view())->GetScreenInfo(¶ms.screen_info); |
| 221 } else { |
| 222 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 223 ¶ms.screen_info); |
| 224 } |
| 225 #else |
| 226 params.screen_info = |
| 227 WebKit::WebScreenInfoFactory::screenInfo( |
| 228 gfx::NativeViewFromId(GetNativeViewId())); |
| 229 #endif |
| 230 |
| 214 Send(new ViewMsg_New(params)); | 231 Send(new ViewMsg_New(params)); |
| 215 | 232 |
| 216 // If it's enabled, tell the renderer to set up the Javascript bindings for | 233 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| 217 // sending messages back to the browser. | 234 // sending messages back to the browser. |
| 218 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); | 235 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); |
| 219 // Let our delegate know that we created a RenderView. | 236 // Let our delegate know that we created a RenderView. |
| 220 delegate_->RenderViewCreated(this); | 237 delegate_->RenderViewCreated(this); |
| 221 | 238 |
| 222 // Invert the color scheme if a flag was set. | 239 // Invert the color scheme if a flag was set. |
| 223 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) | 240 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) |
| (...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 // Whenever we change swap out state, we should not be waiting for | 1617 // Whenever we change swap out state, we should not be waiting for |
| 1601 // beforeunload or unload acks. We clear them here to be safe, since they | 1618 // beforeunload or unload acks. We clear them here to be safe, since they |
| 1602 // can cause navigations to be ignored in OnMsgNavigate. | 1619 // can cause navigations to be ignored in OnMsgNavigate. |
| 1603 is_waiting_for_beforeunload_ack_ = false; | 1620 is_waiting_for_beforeunload_ack_ = false; |
| 1604 is_waiting_for_unload_ack_ = false; | 1621 is_waiting_for_unload_ack_ = false; |
| 1605 } | 1622 } |
| 1606 | 1623 |
| 1607 void RenderViewHost::ClearPowerSaveBlockers() { | 1624 void RenderViewHost::ClearPowerSaveBlockers() { |
| 1608 STLDeleteValues(&power_save_blockers_); | 1625 STLDeleteValues(&power_save_blockers_); |
| 1609 } | 1626 } |
| OLD | NEW |