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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 return browser; | 437 return browser; |
438 return chrome::FindOrCreateTabbedBrowser( | 438 return chrome::FindOrCreateTabbedBrowser( |
439 ProfileManager::GetDefaultProfileOrOffTheRecord(), | 439 ProfileManager::GetDefaultProfileOrOffTheRecord(), |
440 chrome::HOST_DESKTOP_TYPE_ASH); | 440 chrome::HOST_DESKTOP_TYPE_ASH); |
441 } | 441 } |
442 | 442 |
443 keyboard::KeyboardControllerProxy* | 443 keyboard::KeyboardControllerProxy* |
444 ChromeShellDelegate::CreateKeyboardControllerProxy() { | 444 ChromeShellDelegate::CreateKeyboardControllerProxy() { |
445 return new AshKeyboardControllerProxy(); | 445 return new AshKeyboardControllerProxy(); |
446 } | 446 } |
OLD | NEW |