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

Side by Side Diff: ash/wm/window_cycle_controller.cc

Issue 2072853002: Implement "pinned" mode in ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix linux build breakage 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/wm/window_cycle_controller.h" 5 #include "ash/wm/window_cycle_controller.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/wm/mru_window_tracker.h" 8 #include "ash/common/wm/mru_window_tracker.h"
9 #include "ash/common/wm_shell.h"
9 #include "ash/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
10 #include "ash/shell.h" 11 #include "ash/shell.h"
11 #include "ash/wm/window_cycle_list.h" 12 #include "ash/wm/window_cycle_list.h"
12 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
13 #include "ui/events/event.h" 14 #include "ui/events/event.h"
14 #include "ui/events/event_handler.h" 15 #include "ui/events/event_handler.h"
15 16
16 namespace ash { 17 namespace ash {
17 18
18 namespace { 19 namespace {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 67 }
67 68
68 WindowCycleController::~WindowCycleController() { 69 WindowCycleController::~WindowCycleController() {
69 } 70 }
70 71
71 // static 72 // static
72 bool WindowCycleController::CanCycle() { 73 bool WindowCycleController::CanCycle() {
73 // Don't allow window cycling if the screen is locked or a modal dialog is 74 // Don't allow window cycling if the screen is locked or a modal dialog is
74 // open. 75 // open.
75 return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() && 76 return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() &&
76 !Shell::GetInstance()->IsSystemModalWindowOpen(); 77 !Shell::GetInstance()->IsSystemModalWindowOpen() &&
78 !WmShell::Get()->IsPinned();
77 } 79 }
78 80
79 void WindowCycleController::HandleCycleWindow(Direction direction) { 81 void WindowCycleController::HandleCycleWindow(Direction direction) {
80 if (!CanCycle()) 82 if (!CanCycle())
81 return; 83 return;
82 84
83 if (!IsCycling()) 85 if (!IsCycling())
84 StartCycling(); 86 StartCycling();
85 87
86 Step(direction); 88 Step(direction);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 active_window_before_window_cycle_ != active_window_after_window_cycle) { 123 active_window_before_window_cycle_ != active_window_after_window_cycle) {
122 Shell::GetInstance() 124 Shell::GetInstance()
123 ->metrics() 125 ->metrics()
124 ->task_switch_metrics_recorder() 126 ->task_switch_metrics_recorder()
125 .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER); 127 .OnTaskSwitch(TaskSwitchMetricsRecorder::WINDOW_CYCLE_CONTROLLER);
126 } 128 }
127 active_window_before_window_cycle_ = nullptr; 129 active_window_before_window_cycle_ = nullptr;
128 } 130 }
129 131
130 } // namespace ash 132 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698