OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 #if defined(OS_CHROMEOS) | 203 #if defined(OS_CHROMEOS) |
204 #include "chrome/browser/chromeos/boot_times_loader.h" | 204 #include "chrome/browser/chromeos/boot_times_loader.h" |
205 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 205 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
206 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 206 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
207 #if defined(USE_AURA) | 207 #if defined(USE_AURA) |
208 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 208 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
209 #endif | 209 #endif |
210 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 210 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
211 #endif | 211 #endif |
212 | 212 |
213 #if defined(USE_AURA) | 213 #if defined(USE_ASH) |
214 #include "ash/ash_switches.h" | 214 #include "ash/ash_switches.h" |
215 #include "ash/shell.h" | 215 #include "ash/shell.h" |
216 #include "chrome/browser/ui/views/ash/panel_view_aura.h" | 216 #include "chrome/browser/ui/views/ash/panel_view_aura.h" |
217 #endif | 217 #endif |
218 | 218 |
219 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 219 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
220 #include "chrome/browser/download/download_shelf.h" | 220 #include "chrome/browser/download/download_shelf.h" |
221 #endif | 221 #endif |
222 | 222 |
223 #if defined(FILE_MANAGER_EXTENSION) | 223 #if defined(FILE_MANAGER_EXTENSION) |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 case extension_misc::LAUNCH_SHELL: { | 710 case extension_misc::LAUNCH_SHELL: { |
711 ShellWindow* shell_window = ShellWindow::Create( | 711 ShellWindow* shell_window = ShellWindow::Create( |
712 profile, | 712 profile, |
713 extension, | 713 extension, |
714 UrlForExtension(extension, override_url)); | 714 UrlForExtension(extension, override_url)); |
715 if (shell_window) | 715 if (shell_window) |
716 tab = shell_window->web_contents(); | 716 tab = shell_window->web_contents(); |
717 break; | 717 break; |
718 } | 718 } |
719 case extension_misc::LAUNCH_PANEL: | 719 case extension_misc::LAUNCH_PANEL: |
720 #if defined(USE_AURA) | 720 #if defined(USE_ASH) |
721 if (extension && | 721 if (extension && |
722 CommandLine::ForCurrentProcess()->HasSwitch( | 722 CommandLine::ForCurrentProcess()->HasSwitch( |
723 ash::switches::kAuraPanelManager)) { | 723 ash::switches::kAuraPanelManager)) { |
724 tab = OpenApplicationPanel(profile, extension, override_url); | 724 tab = OpenApplicationPanel(profile, extension, override_url); |
725 break; | 725 break; |
726 } | 726 } |
727 // else fall through to LAUNCH_WINDOW | 727 // else fall through to LAUNCH_WINDOW |
728 #endif | 728 #endif |
729 case extension_misc::LAUNCH_WINDOW: | 729 case extension_misc::LAUNCH_WINDOW: |
730 tab = Browser::OpenApplicationWindow(profile, extension, container, | 730 tab = Browser::OpenApplicationWindow(profile, extension, container, |
731 override_url, NULL); | 731 override_url, NULL); |
732 break; | 732 break; |
733 case extension_misc::LAUNCH_TAB: { | 733 case extension_misc::LAUNCH_TAB: { |
734 tab = Browser::OpenApplicationTab(profile, extension, override_url, | 734 tab = Browser::OpenApplicationTab(profile, extension, override_url, |
735 disposition); | 735 disposition); |
736 break; | 736 break; |
737 } | 737 } |
738 default: | 738 default: |
739 NOTREACHED(); | 739 NOTREACHED(); |
740 break; | 740 break; |
741 } | 741 } |
742 return tab; | 742 return tab; |
743 } | 743 } |
744 | 744 |
745 #if defined(USE_AURA) | 745 #if defined(USE_ASH) |
746 // static | 746 // static |
747 WebContents* Browser::OpenApplicationPanel( | 747 WebContents* Browser::OpenApplicationPanel( |
748 Profile* profile, | 748 Profile* profile, |
749 const Extension* extension, | 749 const Extension* extension, |
750 const GURL& url_input) { | 750 const GURL& url_input) { |
751 GURL url = UrlForExtension(extension, url_input); | 751 GURL url = UrlForExtension(extension, url_input); |
752 std::string app_name = | 752 std::string app_name = |
753 web_app::GenerateApplicationNameFromExtensionId(extension->id()); | 753 web_app::GenerateApplicationNameFromExtensionId(extension->id()); |
754 gfx::Rect panel_bounds; | 754 gfx::Rect panel_bounds; |
755 panel_bounds.set_width(extension->launch_width()); | 755 panel_bounds.set_width(extension->launch_width()); |
(...skipping 3823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4579 } | 4579 } |
4580 | 4580 |
4581 /////////////////////////////////////////////////////////////////////////////// | 4581 /////////////////////////////////////////////////////////////////////////////// |
4582 // Browser, protected: | 4582 // Browser, protected: |
4583 | 4583 |
4584 BrowserWindow* Browser::CreateBrowserWindow() { | 4584 BrowserWindow* Browser::CreateBrowserWindow() { |
4585 // TODO(yfriedman): remove OS_ANDROID clause when browser is excluded from | 4585 // TODO(yfriedman): remove OS_ANDROID clause when browser is excluded from |
4586 // Android build. | 4586 // Android build. |
4587 #if !defined(OS_ANDROID) | 4587 #if !defined(OS_ANDROID) |
4588 bool create_panel = false; | 4588 bool create_panel = false; |
4589 #if defined(USE_AURA) | 4589 #if defined(USE_ASH) |
4590 if (CommandLine::ForCurrentProcess()->HasSwitch( | 4590 if (CommandLine::ForCurrentProcess()->HasSwitch( |
4591 ash::switches::kAuraPanelManager)) | 4591 ash::switches::kAuraPanelManager)) |
4592 create_panel = is_type_panel(); | 4592 create_panel = is_type_panel(); |
4593 #elif !defined(OS_CHROMEOS) | 4593 #elif !defined(OS_CHROMEOS) |
4594 create_panel = is_type_panel(); | 4594 create_panel = is_type_panel(); |
4595 #endif | 4595 #endif |
4596 if (create_panel) | 4596 if (create_panel) |
4597 return PanelManager::GetInstance()->CreatePanel(this); | 4597 return PanelManager::GetInstance()->CreatePanel(this); |
4598 #endif // OS_ANDROID | 4598 #endif // OS_ANDROID |
4599 | 4599 |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5620 } else { | 5620 } else { |
5621 LoginUIServiceFactory::GetForProfile( | 5621 LoginUIServiceFactory::GetForProfile( |
5622 profile()->GetOriginalProfile())->ShowLoginUI(); | 5622 profile()->GetOriginalProfile())->ShowLoginUI(); |
5623 } | 5623 } |
5624 #endif | 5624 #endif |
5625 } | 5625 } |
5626 | 5626 |
5627 void Browser::ToggleSpeechInput() { | 5627 void Browser::ToggleSpeechInput() { |
5628 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5628 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5629 } | 5629 } |
OLD | NEW |