| 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/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include "ash/host/root_window_host_factory.h" | 7 #include "ash/host/root_window_host_factory.h" |
| 8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
| 9 #include "ash/magnifier/magnifier_constants.h" | 9 #include "ash/magnifier/magnifier_constants.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| 11 #include "ash/wm/stacking_controller.h" | 11 #include "ash/wm/stacking_controller.h" |
| 12 #include "ash/wm/window_properties.h" |
| 12 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
| 13 #include "base/bind.h" | 14 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 16 #include "chrome/browser/chromeos/login/screen_locker.h" | 17 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 17 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" | 18 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h" |
| 18 #include "chrome/browser/lifetime/application_lifetime.h" | 19 #include "chrome/browser/lifetime/application_lifetime.h" |
| 19 #include "chrome/browser/prefs/pref_service.h" | 20 #include "chrome/browser/prefs/pref_service.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/browser/sessions/tab_restore_service.h" | 22 #include "chrome/browser/sessions/tab_restore_service.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void ChromeShellDelegate::ToggleMaximized() { | 201 void ChromeShellDelegate::ToggleMaximized() { |
| 201 aura::Window* window = ash::wm::GetActiveWindow(); | 202 aura::Window* window = ash::wm::GetActiveWindow(); |
| 202 if (!window) | 203 if (!window) |
| 203 return; | 204 return; |
| 204 // Get out of fullscreen when in fullscreen mode. | 205 // Get out of fullscreen when in fullscreen mode. |
| 205 if (ash::wm::IsWindowFullscreen(window)) { | 206 if (ash::wm::IsWindowFullscreen(window)) { |
| 206 chrome::ToggleFullscreenMode(GetTargetBrowser()); | 207 chrome::ToggleFullscreenMode(GetTargetBrowser()); |
| 207 return; | 208 return; |
| 208 } | 209 } |
| 209 ash::wm::ToggleMaximizedWindow(window); | 210 ash::wm::ToggleMaximizedWindow(window); |
| 211 // Experiment with automatically entering immersive mode when the user presses |
| 212 // the F4 maximize key. |
| 213 window->SetProperty(ash::internal::kImmersiveModeKey, |
| 214 ash::wm::IsWindowMaximized(window)); |
| 210 } | 215 } |
| 211 | 216 |
| 212 void ChromeShellDelegate::OpenFileManager() { | 217 void ChromeShellDelegate::OpenFileManager() { |
| 213 #if defined(OS_CHROMEOS) | 218 #if defined(OS_CHROMEOS) |
| 214 Browser* browser = | 219 Browser* browser = |
| 215 chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); | 220 chrome::FindBrowserWithWindow(ash::wm::GetActiveWindow()); |
| 216 // Open the select file dialog only if there is an active browser where the | 221 // Open the select file dialog only if there is an active browser where the |
| 217 // selected file is displayed. | 222 // selected file is displayed. |
| 218 if (browser) { | 223 if (browser) { |
| 219 browser->OpenFile(); | 224 browser->OpenFile(); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 ash::Shell::GetInstance()->ShowLauncher(); | 582 ash::Shell::GetInstance()->ShowLauncher(); |
| 578 break; | 583 break; |
| 579 default: | 584 default: |
| 580 NOTREACHED() << "Unexpected notification " << type; | 585 NOTREACHED() << "Unexpected notification " << type; |
| 581 } | 586 } |
| 582 #else | 587 #else |
| 583 // MSVC++ warns about switch statements without any cases. | 588 // MSVC++ warns about switch statements without any cases. |
| 584 NOTREACHED() << "Unexpected notification " << type; | 589 NOTREACHED() << "Unexpected notification " << type; |
| 585 #endif | 590 #endif |
| 586 } | 591 } |
| OLD | NEW |