Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: ash/accelerators/accelerator_commands.cc

Issue 42353002: Introduce WindowStateDelegate::ToggleFullscreen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude accelerator_commands_browsertest on win Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/accelerators/accelerator_commands.h" 5 #include "ash/accelerators/accelerator_commands.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/wm/window_cycle_controller.h" 9 #include "ash/wm/window_cycle_controller.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 19 matching lines...) Expand all
30 window_state->Minimize(); 30 window_state->Minimize();
31 return true; 31 return true;
32 } 32 }
33 33
34 void ToggleMaximized() { 34 void ToggleMaximized() {
35 wm::WindowState* window_state = wm::GetActiveWindowState(); 35 wm::WindowState* window_state = wm::GetActiveWindowState();
36 if (!window_state) 36 if (!window_state)
37 return; 37 return;
38 // Get out of fullscreen when in fullscreen mode. 38 // Get out of fullscreen when in fullscreen mode.
39 if (window_state->IsFullscreen()) 39 if (window_state->IsFullscreen())
40 Shell::GetInstance()->delegate()->ToggleFullscreen(); 40 ToggleFullscreen();
41 else 41 else
42 window_state->ToggleMaximized(); 42 window_state->ToggleMaximized();
43 } 43 }
44 44
45 void ToggleFullscreen() {
46 wm::WindowState* window_state = wm::GetActiveWindowState();
47 if (window_state)
48 window_state->ToggleFullscreen();
49 }
50
45 } // namespace accelerators 51 } // namespace accelerators
46 } // namespace ash 52 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_commands.h ('k') | ash/accelerators/accelerator_commands_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698