diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 01:57:31 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 01:57:31 +0000 |
commit | c4755fd5e6a21187410aa07b3333c83ae5da7316 (patch) | |
tree | c65608ad0f6be193b767393c8dfddadf9890ad23 /ash/accelerators | |
parent | b857e4f068b60b34f853a13c1ee35f8377fec329 (diff) | |
download | chromium_src-c4755fd5e6a21187410aa07b3333c83ae5da7316.zip chromium_src-c4755fd5e6a21187410aa07b3333c83ae5da7316.tar.gz chromium_src-c4755fd5e6a21187410aa07b3333c83ae5da7316.tar.bz2 |
Move ToggleMaximized impl to ash and remove ShellDelegate::ToggleMaximized
BUG=272460
Review URL: https://codereview.chromium.org/29153006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/accelerators')
-rw-r--r-- | ash/accelerators/accelerator_commands.cc | 11 | ||||
-rw-r--r-- | ash/accelerators/accelerator_commands.h | 4 | ||||
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 2 |
3 files changed, 16 insertions, 1 deletions
diff --git a/ash/accelerators/accelerator_commands.cc b/ash/accelerators/accelerator_commands.cc index c3271b4..1cb326d 100644 --- a/ash/accelerators/accelerator_commands.cc +++ b/ash/accelerators/accelerator_commands.cc @@ -34,5 +34,16 @@ bool ToggleMinimized() { return true; } +void ToggleMaximized() { + wm::WindowState* window_state = wm::GetActiveWindowState(); + if (!window_state) + return; + // Get out of fullscreen when in fullscreen mode. + if (window_state->IsFullscreen()) + Shell::GetInstance()->delegate()->ToggleFullscreen(); + else + window_state->ToggleMaximized(); +} + } // namespace accelerators } // namespace ash diff --git a/ash/accelerators/accelerator_commands.h b/ash/accelerators/accelerator_commands.h index 5fe2775..36006e7 100644 --- a/ash/accelerators/accelerator_commands.h +++ b/ash/accelerators/accelerator_commands.h @@ -17,6 +17,10 @@ namespace accelerators { // restored. ASH_EXPORT bool ToggleMinimized(); +// Toggles the maxmized state. If the window is in fulllscreen, it exits +// fullscreen mode. +ASH_EXPORT void ToggleMaximized(); + } // namespace accelerators } // namespace ash diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index cf3abeb..4a73ee4 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -846,7 +846,7 @@ bool AcceleratorController::PerformAction(int action, return true; } case TOGGLE_MAXIMIZED: { - shell->delegate()->ToggleMaximized(); + accelerators::ToggleMaximized(); return true; } case WINDOW_POSITION_CENTER: { |