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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 tab_contents, | 237 tab_contents, |
238 params.window_container_type, | 238 params.window_container_type, |
239 params.frame_name); | 239 params.frame_name); |
240 | 240 |
241 if (new_contents) { | 241 if (new_contents) { |
242 content::RetargetingDetails details; | 242 content::RetargetingDetails details; |
243 details.source_tab_contents = tab_contents; | 243 details.source_tab_contents = tab_contents; |
244 details.source_frame_id = params.opener_frame_id; | 244 details.source_frame_id = params.opener_frame_id; |
245 details.target_url = params.target_url; | 245 details.target_url = params.target_url; |
246 details.target_tab_contents = new_contents; | 246 details.target_tab_contents = new_contents; |
247 Profile* profile = | |
248 Profile::FromBrowserContext(tab_contents->browser_context()); | |
249 NotificationService::current()->Notify( | 247 NotificationService::current()->Notify( |
250 content::NOTIFICATION_RETARGETING, | 248 content::NOTIFICATION_RETARGETING, |
251 Source<Profile>(profile), | 249 Source<content::BrowserContext>(tab_contents->browser_context()), |
252 Details<content::RetargetingDetails>(&details)); | 250 Details<content::RetargetingDetails>(&details)); |
253 | 251 |
254 if (tab_contents->delegate()) | 252 if (tab_contents->delegate()) |
255 tab_contents->delegate()->TabContentsCreated(new_contents); | 253 tab_contents->delegate()->TabContentsCreated(new_contents); |
256 } else { | 254 } else { |
257 NotificationService::current()->Notify( | 255 NotificationService::current()->Notify( |
258 content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, | 256 content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, |
259 Source<TabContents>(tab_contents), | 257 Source<TabContents>(tab_contents), |
260 Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); | 258 Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); |
261 } | 259 } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 DictionaryValue* inspector_settings = update.Get(); | 491 DictionaryValue* inspector_settings = update.Get(); |
494 inspector_settings->SetWithoutPathExpansion(key, | 492 inspector_settings->SetWithoutPathExpansion(key, |
495 Value::CreateStringValue(value)); | 493 Value::CreateStringValue(value)); |
496 } | 494 } |
497 | 495 |
498 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 496 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
499 content::BrowserContext* browser_context) { | 497 content::BrowserContext* browser_context) { |
500 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 498 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
501 ClearPref(prefs::kWebKitInspectorSettings); | 499 ClearPref(prefs::kWebKitInspectorSettings); |
502 } | 500 } |
OLD | NEW |