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 <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
13 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "base/values.h" | 19 #include "base/values.h" |
20 #include "content/browser/child_process_security_policy.h" | 20 #include "content/browser/child_process_security_policy.h" |
21 #include "content/browser/cross_site_request_manager.h" | 21 #include "content/browser/cross_site_request_manager.h" |
22 #include "content/browser/gpu/gpu_surface_tracker.h" | 22 #include "content/browser/gpu/gpu_surface_tracker.h" |
23 #include "content/browser/host_zoom_map.h" | 23 #include "content/browser/host_zoom_map.h" |
24 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 24 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
25 #include "content/browser/power_save_blocker.h" | 25 #include "content/browser/power_save_blocker.h" |
26 #include "content/browser/renderer_host/render_process_host_impl.h" | 26 #include "content/browser/renderer_host/render_process_host_impl.h" |
27 #include "content/browser/renderer_host/render_widget_host.h" | 27 #include "content/browser/renderer_host/render_widget_host.h" |
28 #include "content/browser/renderer_host/render_widget_host_view.h" | 28 #include "content/browser/renderer_host/render_widget_host_view.h" |
29 #include "content/browser/site_instance.h" | |
30 #include "content/common/desktop_notification_messages.h" | 29 #include "content/common/desktop_notification_messages.h" |
31 #include "content/common/drag_messages.h" | 30 #include "content/common/drag_messages.h" |
32 #include "content/common/speech_input_messages.h" | 31 #include "content/common/speech_input_messages.h" |
33 #include "content/common/swapped_out_messages.h" | 32 #include "content/common/swapped_out_messages.h" |
34 #include "content/common/view_messages.h" | 33 #include "content/common/view_messages.h" |
35 #include "content/public/browser/browser_context.h" | 34 #include "content/public/browser/browser_context.h" |
36 #include "content/public/browser/browser_message_filter.h" | 35 #include "content/public/browser/browser_message_filter.h" |
37 #include "content/public/browser/content_browser_client.h" | 36 #include "content/public/browser/content_browser_client.h" |
38 #include "content/public/browser/native_web_keyboard_event.h" | 37 #include "content/public/browser/native_web_keyboard_event.h" |
39 #include "content/public/browser/notification_details.h" | 38 #include "content/public/browser/notification_details.h" |
(...skipping 11 matching lines...) Expand all Loading... |
51 #include "third_party/skia/include/core/SkBitmap.h" | 50 #include "third_party/skia/include/core/SkBitmap.h" |
52 #include "ui/gfx/native_widget_types.h" | 51 #include "ui/gfx/native_widget_types.h" |
53 #include "webkit/glue/context_menu.h" | 52 #include "webkit/glue/context_menu.h" |
54 #include "webkit/glue/webaccessibility.h" | 53 #include "webkit/glue/webaccessibility.h" |
55 #include "webkit/glue/webdropdata.h" | 54 #include "webkit/glue/webdropdata.h" |
56 | 55 |
57 using base::TimeDelta; | 56 using base::TimeDelta; |
58 using content::BrowserMessageFilter; | 57 using content::BrowserMessageFilter; |
59 using content::BrowserThread; | 58 using content::BrowserThread; |
60 using content::RenderViewHostDelegate; | 59 using content::RenderViewHostDelegate; |
| 60 using content::SiteInstance; |
61 using content::UserMetricsAction; | 61 using content::UserMetricsAction; |
62 using WebKit::WebConsoleMessage; | 62 using WebKit::WebConsoleMessage; |
63 using WebKit::WebDragOperation; | 63 using WebKit::WebDragOperation; |
64 using WebKit::WebDragOperationNone; | 64 using WebKit::WebDragOperationNone; |
65 using WebKit::WebDragOperationsMask; | 65 using WebKit::WebDragOperationsMask; |
66 using WebKit::WebInputEvent; | 66 using WebKit::WebInputEvent; |
67 using WebKit::WebMediaPlayerAction; | 67 using WebKit::WebMediaPlayerAction; |
68 using WebKit::WebPluginAction; | 68 using WebKit::WebPluginAction; |
69 | 69 |
70 namespace { | 70 namespace { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if (!widget || !widget->IsRenderView()) | 103 if (!widget || !widget->IsRenderView()) |
104 return NULL; | 104 return NULL; |
105 return static_cast<RenderViewHost*>(widget); | 105 return static_cast<RenderViewHost*>(widget); |
106 } | 106 } |
107 | 107 |
108 RenderViewHost::RenderViewHost(SiteInstance* instance, | 108 RenderViewHost::RenderViewHost(SiteInstance* instance, |
109 RenderViewHostDelegate* delegate, | 109 RenderViewHostDelegate* delegate, |
110 int routing_id, | 110 int routing_id, |
111 SessionStorageNamespace* session_storage) | 111 SessionStorageNamespace* session_storage) |
112 : RenderWidgetHost(instance->GetProcess(), routing_id), | 112 : RenderWidgetHost(instance->GetProcess(), routing_id), |
113 instance_(instance), | 113 instance_(static_cast<SiteInstanceImpl*>(instance)), |
114 delegate_(delegate), | 114 delegate_(delegate), |
115 waiting_for_drag_context_response_(false), | 115 waiting_for_drag_context_response_(false), |
116 enabled_bindings_(0), | 116 enabled_bindings_(0), |
117 pending_request_id_(-1), | 117 pending_request_id_(-1), |
118 navigations_suspended_(false), | 118 navigations_suspended_(false), |
119 suspended_nav_message_(NULL), | 119 suspended_nav_message_(NULL), |
120 is_swapped_out_(false), | 120 is_swapped_out_(false), |
121 run_modal_reply_msg_(NULL), | 121 run_modal_reply_msg_(NULL), |
122 is_waiting_for_beforeunload_ack_(false), | 122 is_waiting_for_beforeunload_ack_(false), |
123 is_waiting_for_unload_ack_(false), | 123 is_waiting_for_unload_ack_(false), |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 | 1545 |
1546 void RenderViewHost::OnWebUISend(const GURL& source_url, | 1546 void RenderViewHost::OnWebUISend(const GURL& source_url, |
1547 const std::string& name, | 1547 const std::string& name, |
1548 const base::ListValue& args) { | 1548 const base::ListValue& args) { |
1549 delegate_->WebUISend(this, source_url, name, args); | 1549 delegate_->WebUISend(this, source_url, name, args); |
1550 } | 1550 } |
1551 | 1551 |
1552 void RenderViewHost::ClearPowerSaveBlockers() { | 1552 void RenderViewHost::ClearPowerSaveBlockers() { |
1553 STLDeleteValues(&power_save_blockers_); | 1553 STLDeleteValues(&power_save_blockers_); |
1554 } | 1554 } |
OLD | NEW |