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

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

Issue 10823394: [aura] Stop accelerators that are not allowed on login screen from working on user image screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return false; // not an accelerator. 363 return false; // not an accelerator.
364 364
365 return reserved_actions_.find(iter->second) != reserved_actions_.end(); 365 return reserved_actions_.find(iter->second) != reserved_actions_.end();
366 } 366 }
367 367
368 bool AcceleratorController::PerformAction(int action, 368 bool AcceleratorController::PerformAction(int action,
369 const ui::Accelerator& accelerator) { 369 const ui::Accelerator& accelerator) {
370 ash::Shell* shell = ash::Shell::GetInstance(); 370 ash::Shell* shell = ash::Shell::GetInstance();
371 bool at_login_screen = false; 371 bool at_login_screen = false;
372 #if defined(OS_CHROMEOS) 372 #if defined(OS_CHROMEOS)
373 at_login_screen = (shell->delegate() && !shell->delegate()->IsUserLoggedIn()); 373 at_login_screen = shell->delegate() && !shell->delegate()->IsSessionStarted();
374 #endif 374 #endif
375 bool at_lock_screen = shell->IsScreenLocked(); 375 bool at_lock_screen = shell->IsScreenLocked();
376 376
377 if (at_login_screen && 377 if (at_login_screen &&
378 actions_allowed_at_login_screen_.find(action) == 378 actions_allowed_at_login_screen_.find(action) ==
379 actions_allowed_at_login_screen_.end()) { 379 actions_allowed_at_login_screen_.end()) {
380 return false; 380 return false;
381 } 381 }
382 if (at_lock_screen && 382 if (at_lock_screen &&
383 actions_allowed_at_lock_screen_.find(action) == 383 actions_allowed_at_lock_screen_.find(action) ==
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 accelerators_.insert( 751 accelerators_.insert(
752 std::make_pair(accelerator, accelerators[i].action)); 752 std::make_pair(accelerator, accelerators[i].action));
753 } 753 }
754 } 754 }
755 755
756 bool AcceleratorController::CanHandleAccelerators() const { 756 bool AcceleratorController::CanHandleAccelerators() const {
757 return true; 757 return true;
758 } 758 }
759 759
760 } // namespace ash 760 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698