| 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" |
| 11 #include "chrome/browser/platform_util.h" | 11 #include "chrome/browser/platform_util.h" |
| 12 #include "chrome/browser/printing/print_preview_message_handler.h" | 12 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 13 #include "chrome/browser/printing/print_view_manager.h" | 13 #include "chrome/browser/printing/print_view_manager.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_dialogs.h" | 15 #include "chrome/browser/ui/browser_dialogs.h" |
| 16 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 17 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
| 18 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
| 19 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
| 20 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
| 21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/browser/web_contents_view.h" | 22 #include "content/public/browser/web_contents_view.h" |
| 23 | 23 |
| 24 #if defined(USE_ASH) | 24 #if defined(USE_ASH) |
| 25 #include "ash/launcher/launcher_types.h" | 25 #include "ash/launcher/launcher_types.h" |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 namespace chrome { |
| 29 |
| 28 namespace { | 30 namespace { |
| 29 | 31 |
| 30 bool disable_external_open_for_testing_ = false; | 32 bool disable_external_open_for_testing_ = false; |
| 31 | 33 |
| 32 } // namespace | 34 } // namespace |
| 33 | 35 |
| 34 ShellWindowLinkDelegate::ShellWindowLinkDelegate() {} | 36 ShellWindowLinkDelegate::ShellWindowLinkDelegate() {} |
| 35 | 37 |
| 36 ShellWindowLinkDelegate::~ShellWindowLinkDelegate() {} | 38 ShellWindowLinkDelegate::~ShellWindowLinkDelegate() {} |
| 37 | 39 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 56 void ChromeShellWindowDelegate::InitWebContents( | 58 void ChromeShellWindowDelegate::InitWebContents( |
| 57 content::WebContents* web_contents) { | 59 content::WebContents* web_contents) { |
| 58 FaviconTabHelper::CreateForWebContents(web_contents); | 60 FaviconTabHelper::CreateForWebContents(web_contents); |
| 59 | 61 |
| 60 #if defined(ENABLE_PRINTING) | 62 #if defined(ENABLE_PRINTING) |
| 61 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 63 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 62 printing::PrintViewManager::CreateForWebContents(web_contents); | 64 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 63 #endif | 65 #endif |
| 64 } | 66 } |
| 65 | 67 |
| 66 apps::NativeAppWindow* ChromeShellWindowDelegate::CreateNativeAppWindow( | |
| 67 apps::ShellWindow* window, | |
| 68 const apps::ShellWindow::CreateParams& params) { | |
| 69 return CreateNativeAppWindowImpl(window, params); | |
| 70 } | |
| 71 | |
| 72 content::WebContents* ChromeShellWindowDelegate::OpenURLFromTab( | 68 content::WebContents* ChromeShellWindowDelegate::OpenURLFromTab( |
| 73 Profile* profile, | 69 Profile* profile, |
| 74 content::WebContents* source, | 70 content::WebContents* source, |
| 75 const content::OpenURLParams& params) { | 71 const content::OpenURLParams& params) { |
| 76 // Force all links to open in a new tab, even if they were trying to open a | 72 // Force all links to open in a new tab, even if they were trying to open a |
| 77 // window. | 73 // window. |
| 78 chrome::NavigateParams new_tab_params( | 74 chrome::NavigateParams new_tab_params( |
| 79 static_cast<Browser*>(NULL), params.url, params.transition); | 75 static_cast<Browser*>(NULL), params.url, params.transition); |
| 80 new_tab_params.disposition = params.disposition == NEW_BACKGROUND_TAB ? | 76 new_tab_params.disposition = params.disposition == NEW_BACKGROUND_TAB ? |
| 81 params.disposition : NEW_FOREGROUND_TAB; | 77 params.disposition : NEW_FOREGROUND_TAB; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (host) { | 141 if (host) { |
| 146 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( | 142 host->Send(new ChromeViewMsg_SetVisuallyDeemphasized( |
| 147 host->GetRoutingID(), blocked)); | 143 host->GetRoutingID(), blocked)); |
| 148 } | 144 } |
| 149 } | 145 } |
| 150 | 146 |
| 151 bool ChromeShellWindowDelegate::IsWebContentsVisible( | 147 bool ChromeShellWindowDelegate::IsWebContentsVisible( |
| 152 content::WebContents* web_contents) { | 148 content::WebContents* web_contents) { |
| 153 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); | 149 return platform_util::IsVisible(web_contents->GetView()->GetNativeView()); |
| 154 } | 150 } |
| 151 |
| 152 } // namespace chrome |
| OLD | NEW |