OLD | NEW |
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_window.h" | 10 #include "ash/common/wm_window.h" |
11 #include "ash/display/display_manager.h" | 11 #include "ash/display/display_manager.h" |
12 #include "ash/display/display_util.h" | 12 #include "ash/display/display_util.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/shell_delegate.h" | 14 #include "ash/shell_delegate.h" |
| 15 #include "ash/wm/screen_pinning_controller.h" |
15 #include "ash/wm/window_state_aura.h" | 16 #include "ash/wm/window_state_aura.h" |
16 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
17 #include "base/metrics/user_metrics.h" | 18 #include "base/metrics/user_metrics.h" |
18 | 19 |
19 namespace ash { | 20 namespace ash { |
20 namespace accelerators { | 21 namespace accelerators { |
21 | 22 |
22 bool ToggleMinimized() { | 23 bool ToggleMinimized() { |
23 aura::Window* window = wm::GetActiveWindow(); | 24 aura::Window* window = wm::GetActiveWindow(); |
24 // Attempt to restore the window that would be cycled through next from | 25 // Attempt to restore the window that would be cycled through next from |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 const std::vector<DisplayMode>& modes = display_info.display_modes(); | 101 const std::vector<DisplayMode>& modes = display_info.display_modes(); |
101 auto iter = | 102 auto iter = |
102 std::find_if(modes.begin(), modes.end(), | 103 std::find_if(modes.begin(), modes.end(), |
103 [](const DisplayMode& mode) { return mode.native; }); | 104 [](const DisplayMode& mode) { return mode.native; }); |
104 display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter); | 105 display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter); |
105 } else { | 106 } else { |
106 SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f); | 107 SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f); |
107 } | 108 } |
108 } | 109 } |
109 | 110 |
| 111 void Unpin() { |
| 112 WmWindow* pinned_window = |
| 113 Shell::GetInstance()->screen_pinning_controller()->pinned_window(); |
| 114 if (pinned_window) |
| 115 pinned_window->GetWindowState()->Restore(); |
| 116 } |
| 117 |
110 } // namespace accelerators | 118 } // namespace accelerators |
111 } // namespace ash | 119 } // namespace ash |
OLD | NEW |