OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/apps/chrome_shell_window_delegate.h" | 5 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/favicon/favicon_tab_helper.h" | 8 #include "chrome/browser/favicon/favicon_tab_helper.h" |
9 #include "chrome/browser/file_select_helper.h" | 9 #include "chrome/browser/file_select_helper.h" |
10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 ShellWindowLinkDelegate::ShellWindowLinkDelegate() {} | 41 ShellWindowLinkDelegate::ShellWindowLinkDelegate() {} |
42 | 42 |
43 ShellWindowLinkDelegate::~ShellWindowLinkDelegate() {} | 43 ShellWindowLinkDelegate::~ShellWindowLinkDelegate() {} |
44 | 44 |
45 // TODO(rockot): Add a test that exercises this code. See | 45 // TODO(rockot): Add a test that exercises this code. See |
46 // http://crbug.com/254260. | 46 // http://crbug.com/254260. |
47 content::WebContents* ShellWindowLinkDelegate::OpenURLFromTab( | 47 content::WebContents* ShellWindowLinkDelegate::OpenURLFromTab( |
48 content::WebContents* source, | 48 content::WebContents* source, |
49 const content::OpenURLParams& params) { | 49 const content::OpenURLParams& params) { |
50 platform_util::OpenExternal(params.url); | 50 if (source) { |
| 51 platform_util::OpenExternal( |
| 52 Profile::FromBrowserContext(source->GetBrowserContext()), params.url); |
| 53 } |
51 delete source; | 54 delete source; |
52 return NULL; | 55 return NULL; |
53 } | 56 } |
54 | 57 |
55 ChromeShellWindowDelegate::ChromeShellWindowDelegate() {} | 58 ChromeShellWindowDelegate::ChromeShellWindowDelegate() {} |
56 | 59 |
57 ChromeShellWindowDelegate::~ChromeShellWindowDelegate() {} | 60 ChromeShellWindowDelegate::~ChromeShellWindowDelegate() {} |
58 | 61 |
59 void ChromeShellWindowDelegate::DisableExternalOpenForTesting() { | 62 void ChromeShellWindowDelegate::DisableExternalOpenForTesting() { |
60 disable_external_open_for_testing_ = true; | 63 disable_external_open_for_testing_ = true; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (host) { | 159 if (host) { |
157 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( | 160 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( |
158 host->GetRoutingID(), blocked)); | 161 host->GetRoutingID(), blocked)); |
159 } | 162 } |
160 } | 163 } |
161 | 164 |
162 bool ChromeShellWindowDelegate::IsWebContentsVisible( | 165 bool ChromeShellWindowDelegate::IsWebContentsVisible( |
163 content::WebContents* web_contents) { | 166 content::WebContents* web_contents) { |
164 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); | 167 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); |
165 } | 168 } |
OLD | NEW |