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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 TabContents* new_contents = CreateNewWindow( | 256 TabContents* new_contents = CreateNewWindow( |
257 route_id, | 257 route_id, |
258 Profile::FromBrowserContext(tab_contents->browser_context()), | 258 Profile::FromBrowserContext(tab_contents->browser_context()), |
259 tab_contents->GetSiteInstance(), | 259 tab_contents->GetSiteInstance(), |
260 tab_contents->GetWebUITypeForCurrentState(), | 260 tab_contents->GetWebUITypeForCurrentState(), |
261 tab_contents, | 261 tab_contents, |
262 params.window_container_type, | 262 params.window_container_type, |
263 params.frame_name); | 263 params.frame_name); |
264 | 264 |
265 if (new_contents) { | 265 if (new_contents) { |
| 266 if (tab_contents->delegate()) |
| 267 tab_contents->delegate()->TabContentsCreated(new_contents); |
| 268 |
266 content::RetargetingDetails details; | 269 content::RetargetingDetails details; |
267 details.source_tab_contents = tab_contents; | 270 details.source_tab_contents = tab_contents; |
268 details.source_frame_id = params.opener_frame_id; | 271 details.source_frame_id = params.opener_frame_id; |
269 details.target_url = params.target_url; | 272 details.target_url = params.target_url; |
270 details.target_tab_contents = new_contents; | 273 details.target_tab_contents = new_contents; |
271 content::NotificationService::current()->Notify( | 274 content::NotificationService::current()->Notify( |
272 content::NOTIFICATION_RETARGETING, | 275 content::NOTIFICATION_RETARGETING, |
273 content::Source<content::BrowserContext>( | 276 content::Source<content::BrowserContext>( |
274 tab_contents->browser_context()), | 277 tab_contents->browser_context()), |
275 content::Details<content::RetargetingDetails>(&details)); | 278 content::Details<content::RetargetingDetails>(&details)); |
276 | |
277 if (tab_contents->delegate()) | |
278 tab_contents->delegate()->TabContentsCreated(new_contents); | |
279 } else { | 279 } else { |
280 content::NotificationService::current()->Notify( | 280 content::NotificationService::current()->Notify( |
281 content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, | 281 content::NOTIFICATION_CREATING_NEW_WINDOW_CANCELLED, |
282 content::Source<TabContents>(tab_contents), | 282 content::Source<TabContents>(tab_contents), |
283 content::Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); | 283 content::Details<const ViewHostMsg_CreateWindow_Params>(¶ms)); |
284 } | 284 } |
285 | 285 |
286 return new_contents; | 286 return new_contents; |
287 } | 287 } |
288 | 288 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 DictionaryValue* inspector_settings = update.Get(); | 545 DictionaryValue* inspector_settings = update.Get(); |
546 inspector_settings->SetWithoutPathExpansion(key, | 546 inspector_settings->SetWithoutPathExpansion(key, |
547 Value::CreateStringValue(value)); | 547 Value::CreateStringValue(value)); |
548 } | 548 } |
549 | 549 |
550 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 550 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
551 content::BrowserContext* browser_context) { | 551 content::BrowserContext* browser_context) { |
552 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 552 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
553 ClearPref(prefs::kWebKitInspectorSettings); | 553 ClearPref(prefs::kWebKitInspectorSettings); |
554 } | 554 } |
OLD | NEW |