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

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

Issue 2115663002: Folds methods in WmShellCommon to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 months 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/wm/mru_window_tracker.h" 7 #include "ash/common/wm/mru_window_tracker.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/common/wm/wm_event.h" 9 #include "ash/common/wm/wm_event.h"
10 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 11 #include "ash/common/wm_window.h"
11 #include "ash/display/display_manager.h" 12 #include "ash/display/display_manager.h"
12 #include "ash/display/display_util.h" 13 #include "ash/display/display_util.h"
13 #include "ash/shell.h" 14 #include "ash/shell.h"
14 #include "ash/shell_delegate.h" 15 #include "ash/shell_delegate.h"
15 #include "ash/wm/screen_pinning_controller.h" 16 #include "ash/wm/screen_pinning_controller.h"
16 #include "ash/wm/window_state_aura.h" 17 #include "ash/wm/window_state_aura.h"
17 #include "ash/wm/window_util.h" 18 #include "ash/wm/window_util.h"
18 #include "base/metrics/user_metrics.h" 19 #include "base/metrics/user_metrics.h"
19 20
20 namespace ash { 21 namespace ash {
21 namespace accelerators { 22 namespace accelerators {
22 23
23 bool ToggleMinimized() { 24 bool ToggleMinimized() {
24 aura::Window* window = wm::GetActiveWindow(); 25 aura::Window* window = wm::GetActiveWindow();
25 // Attempt to restore the window that would be cycled through next from 26 // Attempt to restore the window that would be cycled through next from
26 // the launcher when there is no active window. 27 // the launcher when there is no active window.
27 if (!window) { 28 if (!window) {
28 MruWindowTracker::WindowList mru_windows( 29 MruWindowTracker::WindowList mru_windows(
29 Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList()); 30 WmShell::Get()->mru_window_tracker()->BuildMruWindowList());
30 if (!mru_windows.empty()) 31 if (!mru_windows.empty())
31 mru_windows.front()->GetWindowState()->Activate(); 32 mru_windows.front()->GetWindowState()->Activate();
32 return true; 33 return true;
33 } 34 }
34 wm::WindowState* window_state = wm::GetWindowState(window); 35 wm::WindowState* window_state = wm::GetWindowState(window);
35 if (!window_state->CanMinimize()) 36 if (!window_state->CanMinimize())
36 return false; 37 return false;
37 window_state->Minimize(); 38 window_state->Minimize();
38 return true; 39 return true;
39 } 40 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 111
111 void Unpin() { 112 void Unpin() {
112 WmWindow* pinned_window = 113 WmWindow* pinned_window =
113 Shell::GetInstance()->screen_pinning_controller()->pinned_window(); 114 Shell::GetInstance()->screen_pinning_controller()->pinned_window();
114 if (pinned_window) 115 if (pinned_window)
115 pinned_window->GetWindowState()->Restore(); 116 pinned_window->GetWindowState()->Restore();
116 } 117 }
117 118
118 } // namespace accelerators 119 } // namespace accelerators
119 } // namespace ash 120 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698