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