Chromium Code Reviews| 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/apps/app_url_redirector.h" | |
| 8 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 9 #include "chrome/browser/file_select_helper.h" | 10 #include "chrome/browser/file_select_helper.h" |
| 10 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 11 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 11 #include "chrome/browser/platform_util.h" | 12 #include "chrome/browser/platform_util.h" |
| 13 #include "chrome/browser/profiles/profile.h" | |
| 12 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_dialogs.h" | 15 #include "chrome/browser/ui/browser_dialogs.h" |
| 14 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 15 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
| 16 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
| 17 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
| 18 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
| 19 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 20 #include "content/public/browser/web_contents_view.h" | 22 #include "content/public/browser/web_contents_view.h" |
| 21 | 23 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 ChromeShellWindowDelegate::ChromeShellWindowDelegate() {} | 57 ChromeShellWindowDelegate::ChromeShellWindowDelegate() {} |
| 56 | 58 |
| 57 ChromeShellWindowDelegate::~ChromeShellWindowDelegate() {} | 59 ChromeShellWindowDelegate::~ChromeShellWindowDelegate() {} |
| 58 | 60 |
| 59 void ChromeShellWindowDelegate::DisableExternalOpenForTesting() { | 61 void ChromeShellWindowDelegate::DisableExternalOpenForTesting() { |
| 60 disable_external_open_for_testing_ = true; | 62 disable_external_open_for_testing_ = true; |
| 61 } | 63 } |
| 62 | 64 |
| 63 void ChromeShellWindowDelegate::InitWebContents( | 65 void ChromeShellWindowDelegate::InitWebContents( |
| 64 content::WebContents* web_contents) { | 66 content::WebContents* web_contents) { |
| 67 // We don't want to ever send visited URLs to apps in incognito. | |
| 68 // Technically, apps are not supported in incognito, but explicitly check | |
| 69 // for that. See b/240879, which tracks incognito support for v2 apps. | |
| 70 Profile* profile = | |
| 71 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | |
| 72 if (!profile->IsOffTheRecord()) | |
|
not at google - send to devlin
2013/09/04 15:37:21
why do you need to intercept navigations from shel
benwells
2013/09/04 23:54:20
Platform apps can navigate which would normally op
not at google - send to devlin
2013/09/05 00:01:52
It seems like there are a whole bunch of other pla
sergeygs
2013/09/05 09:19:03
To intercept target=_blank and window.open() navig
sergeygs
2013/09/05 09:19:03
Not exactly a whole bunch, according to I found, a
| |
| 73 AppUrlRedirector::CreateForWebContents(web_contents); | |
| 74 | |
| 65 FaviconTabHelper::CreateForWebContents(web_contents); | 75 FaviconTabHelper::CreateForWebContents(web_contents); |
| 66 | 76 |
| 67 #if defined(ENABLE_PRINTING) | 77 #if defined(ENABLE_PRINTING) |
| 68 #if defined(ENABLE_FULL_PRINTING) | 78 #if defined(ENABLE_FULL_PRINTING) |
| 69 printing::PrintViewManager::CreateForWebContents(web_contents); | 79 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 70 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 80 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 71 #else | 81 #else |
| 72 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 82 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
| 73 #endif // defined(ENABLE_FULL_PRINTING) | 83 #endif // defined(ENABLE_FULL_PRINTING) |
| 74 #endif // defined(ENABLE_PRINTING) | 84 #endif // defined(ENABLE_PRINTING) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 156 if (host) { | 166 if (host) { |
| 157 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( | 167 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( |
| 158 host->GetRoutingID(), blocked)); | 168 host->GetRoutingID(), blocked)); |
| 159 } | 169 } |
| 160 } | 170 } |
| 161 | 171 |
| 162 bool ChromeShellWindowDelegate::IsWebContentsVisible( | 172 bool ChromeShellWindowDelegate::IsWebContentsVisible( |
| 163 content::WebContents* web_contents) { | 173 content::WebContents* web_contents) { |
| 164 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); | 174 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); |
| 165 } | 175 } |
| OLD | NEW |