OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 5 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
11 #include "chrome/browser/character_encoding.h" | 11 #include "chrome/browser/character_encoding.h" |
12 #include "chrome/browser/extensions/extensions_service.h" | 12 #include "chrome/browser/extensions/extensions_service.h" |
13 #include "chrome/browser/pref_service.h" | 13 #include "chrome/browser/pref_service.h" |
14 #include "chrome/browser/profile.h" | 14 #include "chrome/browser/profile.h" |
15 #include "chrome/browser/renderer_host/render_view_host.h" | 15 #include "chrome/browser/renderer_host/render_view_host.h" |
16 #include "chrome/browser/renderer_host/render_process_host.h" | 16 #include "chrome/browser/renderer_host/render_process_host.h" |
| 17 #include "chrome/browser/renderer_host/render_widget_fullscreen_host.h" |
17 #include "chrome/browser/renderer_host/render_widget_host.h" | 18 #include "chrome/browser/renderer_host/render_widget_host.h" |
18 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 19 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
19 #include "chrome/browser/renderer_host/site_instance.h" | 20 #include "chrome/browser/renderer_host/site_instance.h" |
20 #include "chrome/browser/tab_contents/background_contents.h" | 21 #include "chrome/browser/tab_contents/background_contents.h" |
21 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
22 #include "chrome/browser/tab_contents/tab_contents_view.h" | 23 #include "chrome/browser/tab_contents/tab_contents_view.h" |
23 #include "chrome/browser/user_style_sheet_watcher.h" | 24 #include "chrome/browser/user_style_sheet_watcher.h" |
24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/notification_service.h" | 26 #include "chrome/common/notification_service.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 new RenderWidgetHost(process, route_id); | 122 new RenderWidgetHost(process, route_id); |
122 RenderWidgetHostView* widget_view = | 123 RenderWidgetHostView* widget_view = |
123 RenderWidgetHostView::CreateViewForWidget(widget_host); | 124 RenderWidgetHostView::CreateViewForWidget(widget_host); |
124 // Popups should not get activated. | 125 // Popups should not get activated. |
125 widget_view->set_popup_type(popup_type); | 126 widget_view->set_popup_type(popup_type); |
126 // Save the created widget associated with the route so we can show it later. | 127 // Save the created widget associated with the route so we can show it later. |
127 pending_widget_views_[route_id] = widget_view; | 128 pending_widget_views_[route_id] = widget_view; |
128 return widget_view; | 129 return widget_view; |
129 } | 130 } |
130 | 131 |
| 132 RenderWidgetHostView* |
| 133 RenderViewHostDelegateViewHelper::CreateNewFullscreenWidget( |
| 134 int route_id, WebKit::WebPopupType popup_type, RenderProcessHost* process) { |
| 135 RenderWidgetFullscreenHost* fullscreen_widget_host = |
| 136 new RenderWidgetFullscreenHost(process, route_id); |
| 137 RenderWidgetHostView* widget_view = |
| 138 RenderWidgetHostView::CreateViewForWidget(fullscreen_widget_host); |
| 139 widget_view->set_popup_type(popup_type); |
| 140 pending_widget_views_[route_id] = widget_view; |
| 141 return widget_view; |
| 142 } |
| 143 |
131 TabContents* RenderViewHostDelegateViewHelper::GetCreatedWindow(int route_id) { | 144 TabContents* RenderViewHostDelegateViewHelper::GetCreatedWindow(int route_id) { |
132 PendingContents::iterator iter = pending_contents_.find(route_id); | 145 PendingContents::iterator iter = pending_contents_.find(route_id); |
133 if (iter == pending_contents_.end()) { | 146 if (iter == pending_contents_.end()) { |
134 DCHECK(false); | 147 DCHECK(false); |
135 return NULL; | 148 return NULL; |
136 } | 149 } |
137 | 150 |
138 RenderViewHost* new_rvh = iter->second; | 151 RenderViewHost* new_rvh = iter->second; |
139 pending_contents_.erase(route_id); | 152 pending_contents_.erase(route_id); |
140 | 153 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 313 } |
301 DCHECK(!web_prefs.default_encoding.empty()); | 314 DCHECK(!web_prefs.default_encoding.empty()); |
302 | 315 |
303 if (is_dom_ui) { | 316 if (is_dom_ui) { |
304 web_prefs.loads_images_automatically = true; | 317 web_prefs.loads_images_automatically = true; |
305 web_prefs.javascript_enabled = true; | 318 web_prefs.javascript_enabled = true; |
306 } | 319 } |
307 | 320 |
308 return web_prefs; | 321 return web_prefs; |
309 } | 322 } |
OLD | NEW |