OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/background_contents_service.h" | 10 #include "chrome/browser/background/background_contents_service.h" |
11 #include "chrome/browser/background/background_contents_service_factory.h" | 11 #include "chrome/browser/background/background_contents_service_factory.h" |
12 #include "chrome/browser/chrome_content_browser_client.h" | 12 #include "chrome/browser/chrome_content_browser_client.h" |
13 #include "chrome/browser/character_encoding.h" | 13 #include "chrome/browser/character_encoding.h" |
14 #include "chrome/browser/extensions/extension_process_manager.h" | 14 #include "chrome/browser/extensions/extension_process_manager.h" |
15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
16 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 16 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
17 #include "chrome/browser/extensions/process_map.h" | 17 #include "chrome/browser/extensions/process_map.h" |
18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
19 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
20 #include "chrome/browser/prerender/prerender_manager.h" | 20 #include "chrome/browser/prerender/prerender_manager.h" |
21 #include "chrome/browser/prerender/prerender_manager_factory.h" | 21 #include "chrome/browser/prerender/prerender_manager_factory.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/tab_contents/background_contents.h" | 23 #include "chrome/browser/tab_contents/background_contents.h" |
| 24 #include "chrome/browser/tab_contents/retargeting_details.h" |
24 #include "chrome/browser/user_style_sheet_watcher.h" | 25 #include "chrome/browser/user_style_sheet_watcher.h" |
25 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
26 #include "chrome/common/chrome_view_type.h" | 27 #include "chrome/common/chrome_view_type.h" |
27 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
28 #include "content/browser/child_process_security_policy.h" | 29 #include "content/browser/child_process_security_policy.h" |
29 #include "content/browser/gpu/gpu_data_manager.h" | 30 #include "content/browser/gpu/gpu_data_manager.h" |
30 #include "content/browser/gpu/gpu_process_host.h" | 31 #include "content/browser/gpu/gpu_process_host.h" |
31 #include "content/browser/renderer_host/render_view_host.h" | 32 #include "content/browser/renderer_host/render_view_host.h" |
32 #include "content/browser/renderer_host/render_widget_fullscreen_host.h" | 33 #include "content/browser/renderer_host/render_widget_fullscreen_host.h" |
33 #include "content/browser/renderer_host/render_widget_host.h" | 34 #include "content/browser/renderer_host/render_widget_host.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 tab_contents->GetSiteInstance(), | 265 tab_contents->GetSiteInstance(), |
265 tab_contents->GetWebUITypeForCurrentState(), | 266 tab_contents->GetWebUITypeForCurrentState(), |
266 tab_contents, | 267 tab_contents, |
267 params.window_container_type, | 268 params.window_container_type, |
268 params.frame_name); | 269 params.frame_name); |
269 | 270 |
270 if (new_contents) { | 271 if (new_contents) { |
271 if (tab_contents->delegate()) | 272 if (tab_contents->delegate()) |
272 tab_contents->delegate()->TabContentsCreated(new_contents); | 273 tab_contents->delegate()->TabContentsCreated(new_contents); |
273 | 274 |
274 content::RetargetingDetails details; | 275 RetargetingDetails details; |
275 details.source_tab_contents = tab_contents; | 276 details.source_tab_contents = tab_contents; |
276 details.source_frame_id = params.opener_frame_id; | 277 details.source_frame_id = params.opener_frame_id; |
277 details.target_url = params.target_url; | 278 details.target_url = params.target_url; |
278 details.target_tab_contents = new_contents; | 279 details.target_tab_contents = new_contents; |
| 280 details.not_yet_in_tabstrip = true; |
279 content::NotificationService::current()->Notify( | 281 content::NotificationService::current()->Notify( |
280 content::NOTIFICATION_RETARGETING, | 282 chrome::NOTIFICATION_RETARGETING, |
281 content::Source<content::BrowserContext>( | 283 content::Source<Profile>( |
282 tab_contents->browser_context()), | 284 Profile::FromBrowserContext(tab_contents->browser_context())), |
283 content::Details<content::RetargetingDetails>(&details)); | 285 content::Details<RetargetingDetails>(&details)); |
284 } else { | 286 } else { |
285 content::NotificationService::current()->Notify( | 287 content::NotificationService::current()->Notify( |
286 content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, | 288 content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, |
287 content::Source<TabContents>(tab_contents), | 289 content::Source<TabContents>(tab_contents), |
288 content::Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); | 290 content::Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); |
289 } | 291 } |
290 | 292 |
291 return new_contents; | 293 return new_contents; |
292 } | 294 } |
293 | 295 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 DictionaryValue* inspector_settings = update.Get(); | 588 DictionaryValue* inspector_settings = update.Get(); |
587 inspector_settings->SetWithoutPathExpansion(key, | 589 inspector_settings->SetWithoutPathExpansion(key, |
588 Value::CreateStringValue(value)); | 590 Value::CreateStringValue(value)); |
589 } | 591 } |
590 | 592 |
591 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 593 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
592 content::BrowserContext* browser_context) { | 594 content::BrowserContext* browser_context) { |
593 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 595 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
594 ClearPref(prefs::kWebKitInspectorSettings); | 596 ClearPref(prefs::kWebKitInspectorSettings); |
595 } | 597 } |
OLD | NEW |