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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 ViewMsg_New_Params params; | 202 ViewMsg_New_Params params; |
200 params.parent_window = GetNativeViewId(); | 203 params.parent_window = GetNativeViewId(); |
201 params.renderer_preferences = | 204 params.renderer_preferences = |
202 delegate_->GetRendererPrefs(process()->GetBrowserContext()); | 205 delegate_->GetRendererPrefs(process()->GetBrowserContext()); |
203 params.web_preferences = delegate_->GetWebkitPrefs(); | 206 params.web_preferences = delegate_->GetWebkitPrefs(); |
204 params.view_id = routing_id(); | 207 params.view_id = routing_id(); |
205 params.surface_id = surface_id(); | 208 params.surface_id = surface_id(); |
206 params.session_storage_namespace_id = session_storage_namespace_->id(); | 209 params.session_storage_namespace_id = session_storage_namespace_->id(); |
207 params.frame_name = frame_name; | 210 params.frame_name = frame_name; |
208 params.next_page_id = next_page_id; | 211 params.next_page_id = next_page_id; |
212 #if defined(OS_POSIX) || defined(USE_AURA) | |
213 if (view()) | |
jam
2012/02/29 23:41:17
brace brackets here and below per style guide
Fady Samuel
2012/03/01 00:52:25
Done.
Fady Samuel
2012/03/01 00:52:25
Done.
| |
214 static_cast<content::RenderWidgetHostViewPort*>( | |
215 view())->GetScreenInfo(¶ms.screen_info); | |
216 else | |
217 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | |
218 ¶ms.screen_info); | |
219 #else | |
220 params.screen_info = | |
221 WebKit::WebScreenInfoFactory::screenInfo( | |
222 gfx::NativeViewFromId(GetNativeViewId())); | |
223 #endif | |
224 | |
209 Send(new ViewMsg_New(params)); | 225 Send(new ViewMsg_New(params)); |
210 | 226 |
211 // If it's enabled, tell the renderer to set up the Javascript bindings for | 227 // If it's enabled, tell the renderer to set up the Javascript bindings for |
212 // sending messages back to the browser. | 228 // sending messages back to the browser. |
213 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); | 229 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); |
214 // Let our delegate know that we created a RenderView. | 230 // Let our delegate know that we created a RenderView. |
215 delegate_->RenderViewCreated(this); | 231 delegate_->RenderViewCreated(this); |
216 | 232 |
217 // Invert the color scheme if a flag was set. | 233 // Invert the color scheme if a flag was set. |
218 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) | 234 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1595 // Whenever we change swap out state, we should not be waiting for | 1611 // Whenever we change swap out state, we should not be waiting for |
1596 // beforeunload or unload acks. We clear them here to be safe, since they | 1612 // beforeunload or unload acks. We clear them here to be safe, since they |
1597 // can cause navigations to be ignored in OnMsgNavigate. | 1613 // can cause navigations to be ignored in OnMsgNavigate. |
1598 is_waiting_for_beforeunload_ack_ = false; | 1614 is_waiting_for_beforeunload_ack_ = false; |
1599 is_waiting_for_unload_ack_ = false; | 1615 is_waiting_for_unload_ack_ = false; |
1600 } | 1616 } |
1601 | 1617 |
1602 void RenderViewHost::ClearPowerSaveBlockers() { | 1618 void RenderViewHost::ClearPowerSaveBlockers() { |
1603 STLDeleteValues(&power_save_blockers_); | 1619 STLDeleteValues(&power_save_blockers_); |
1604 } | 1620 } |
OLD | NEW |