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

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

Issue 2761373002: Move yet more from WmShell to Shell (Closed)
Patch Set: merge Created 3 years, 9 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_filter_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include "ash/common/accelerators/accelerator_table.h" 7 #include "ash/common/accelerators/accelerator_table.h"
8 #include "ash/common/accessibility_delegate.h" 8 #include "ash/common/accessibility_delegate.h"
9 #include "ash/common/accessibility_types.h" 9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 1279
1280 ui::Accelerator CreateAccelerator(const AcceleratorData& data) const { 1280 ui::Accelerator CreateAccelerator(const AcceleratorData& data) const {
1281 ui::Accelerator result(data.keycode, data.modifiers); 1281 ui::Accelerator result(data.keycode, data.modifiers);
1282 result.set_key_state(data.trigger_on_press 1282 result.set_key_state(data.trigger_on_press
1283 ? ui::Accelerator::KeyState::PRESSED 1283 ? ui::Accelerator::KeyState::PRESSED
1284 : ui::Accelerator::KeyState::RELEASED); 1284 : ui::Accelerator::KeyState::RELEASED);
1285 return result; 1285 return result;
1286 } 1286 }
1287 1287
1288 void ResetStateIfNeeded() { 1288 void ResetStateIfNeeded() {
1289 if (WmShell::Get()->session_controller()->IsScreenLocked() || 1289 if (Shell::Get()->session_controller()->IsScreenLocked() ||
1290 WmShell::Get()->session_controller()->IsUserSessionBlocked()) { 1290 Shell::Get()->session_controller()->IsUserSessionBlocked()) {
1291 UnblockUserSession(); 1291 UnblockUserSession();
1292 } 1292 }
1293 } 1293 }
1294 1294
1295 bool ContainsDeprecatedAcceleratorNotification(const char* const id) const { 1295 bool ContainsDeprecatedAcceleratorNotification(const char* const id) const {
1296 return nullptr != message_center()->FindVisibleNotificationById(id); 1296 return nullptr != message_center()->FindVisibleNotificationById(id);
1297 } 1297 }
1298 1298
1299 bool IsMessageCenterEmpty() const { 1299 bool IsMessageCenterEmpty() const {
1300 return message_center()->GetVisibleNotifications().empty(); 1300 return message_center()->GetVisibleNotifications().empty();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 // Expect no notifications from the new accelerators. 1361 // Expect no notifications from the new accelerators.
1362 EXPECT_TRUE(IsMessageCenterEmpty()); 1362 EXPECT_TRUE(IsMessageCenterEmpty());
1363 1363
1364 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1364 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1365 // screen before we proceed testing the rest of accelerators. 1365 // screen before we proceed testing the rest of accelerators.
1366 ResetStateIfNeeded(); 1366 ResetStateIfNeeded();
1367 } 1367 }
1368 } 1368 }
1369 1369
1370 } // namespace ash 1370 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698