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

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

Issue 2078883003: Handle UNPIN operation in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
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_window.h" 10 #include "ash/common/wm_window.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const std::vector<DisplayMode>& modes = display_info.display_modes(); 100 const std::vector<DisplayMode>& modes = display_info.display_modes();
101 auto iter = 101 auto iter =
102 std::find_if(modes.begin(), modes.end(), 102 std::find_if(modes.begin(), modes.end(),
103 [](const DisplayMode& mode) { return mode.native; }); 103 [](const DisplayMode& mode) { return mode.native; });
104 display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter); 104 display_manager->SetDisplayMode(DisplayManager::kUnifiedDisplayId, *iter);
105 } else { 105 } else {
106 SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f); 106 SetDisplayUIScale(display_manager->GetDisplayIdForUIScaling(), 1.0f);
107 } 107 }
108 } 108 }
109 109
110 void Unpin() {
111 wm::WindowState* window_state = wm::GetActiveWindowState();
oshima 2016/06/18 09:48:22 I think it's safer to get pinned window from Scree
hidehiko 2016/06/18 10:02:23 I see. Done.
112 if (window_state->IsPinned())
113 window_state->Restore();
114 }
115
110 } // namespace accelerators 116 } // namespace accelerators
111 } // namespace ash 117 } // 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