| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/host/root_window_host_factory.h" | 8 #include "ash/host/root_window_host_factory.h" |
| 9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
| 10 #include "ash/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "chrome/browser/ui/ash/session_state_delegate.h" | 32 #include "chrome/browser/ui/ash/session_state_delegate.h" |
| 33 #include "chrome/browser/ui/ash/user_action_handler.h" | 33 #include "chrome/browser/ui/ash/user_action_handler.h" |
| 34 #include "chrome/browser/ui/ash/window_positioner.h" | 34 #include "chrome/browser/ui/ash/window_positioner.h" |
| 35 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" |
| 36 #include "chrome/browser/ui/browser_commands.h" | 36 #include "chrome/browser/ui/browser_commands.h" |
| 37 #include "chrome/browser/ui/browser_finder.h" | 37 #include "chrome/browser/ui/browser_finder.h" |
| 38 #include "chrome/browser/ui/browser_window.h" | 38 #include "chrome/browser/ui/browser_window.h" |
| 39 #include "chrome/browser/ui/extensions/native_app_window.h" | 39 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 40 #include "chrome/browser/ui/extensions/shell_window.h" | 40 #include "chrome/browser/ui/extensions/shell_window.h" |
| 41 #include "chrome/browser/ui/host_desktop.h" | 41 #include "chrome/browser/ui/host_desktop.h" |
| 42 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 42 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" |
| 43 #include "chrome/common/chrome_notification_types.h" | 43 #include "chrome/common/chrome_notification_types.h" |
| 44 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
| 45 #include "chrome/common/time_format.h" | 45 #include "chrome/common/time_format.h" |
| 46 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 47 #include "content/public/browser/user_metrics.h" | 47 #include "content/public/browser/user_metrics.h" |
| 48 #include "grit/chromium_strings.h" | 48 #include "grit/chromium_strings.h" |
| 49 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
| 50 #include "ui/aura/client/user_action_client.h" | 50 #include "ui/aura/client/user_action_client.h" |
| 51 #include "ui/aura/window.h" | 51 #include "ui/aura/window.h" |
| 52 #include "ui/base/l10n/l10n_util.h" | 52 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 void ChromeShellDelegate::ToggleMaximized() { | 183 void ChromeShellDelegate::ToggleMaximized() { |
| 184 // Only toggle if the user has a window open. | 184 // Only toggle if the user has a window open. |
| 185 aura::Window* window = ash::wm::GetActiveWindow(); | 185 aura::Window* window = ash::wm::GetActiveWindow(); |
| 186 if (!window) | 186 if (!window) |
| 187 return; | 187 return; |
| 188 | 188 |
| 189 // TODO(pkotwicz): If immersive mode replaces fullscreen, bind fullscreen to | 189 // TODO(pkotwicz): If immersive mode replaces fullscreen, bind fullscreen to |
| 190 // F4 and find a different key binding for maximize. | 190 // F4 and find a different key binding for maximize. |
| 191 if (chrome::UseImmersiveFullscreen()) { | 191 if (ImmersiveFullscreenConfiguration::UseImmersiveFullscreen()) { |
| 192 ToggleFullscreen(); | 192 ToggleFullscreen(); |
| 193 return; | 193 return; |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Get out of fullscreen when in fullscreen mode. | 196 // Get out of fullscreen when in fullscreen mode. |
| 197 if (ash::wm::IsWindowFullscreen(window)) { | 197 if (ash::wm::IsWindowFullscreen(window)) { |
| 198 ToggleFullscreen(); | 198 ToggleFullscreen(); |
| 199 return; | 199 return; |
| 200 } | 200 } |
| 201 ash::wm::ToggleMaximizedWindow(window); | 201 ash::wm::ToggleMaximizedWindow(window); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 return browser; | 431 return browser; |
| 432 return chrome::FindOrCreateTabbedBrowser( | 432 return chrome::FindOrCreateTabbedBrowser( |
| 433 ProfileManager::GetDefaultProfileOrOffTheRecord(), | 433 ProfileManager::GetDefaultProfileOrOffTheRecord(), |
| 434 chrome::HOST_DESKTOP_TYPE_ASH); | 434 chrome::HOST_DESKTOP_TYPE_ASH); |
| 435 } | 435 } |
| 436 | 436 |
| 437 keyboard::KeyboardControllerProxy* | 437 keyboard::KeyboardControllerProxy* |
| 438 ChromeShellDelegate::CreateKeyboardControllerProxy() { | 438 ChromeShellDelegate::CreateKeyboardControllerProxy() { |
| 439 return new AshKeyboardControllerProxy(); | 439 return new AshKeyboardControllerProxy(); |
| 440 } | 440 } |
| OLD | NEW |