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

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

Issue 10907084: ash: Prevent power button events from reaching apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | ash/accelerators/accelerator_table.h » ('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/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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 case MAGNIFY_SCREEN_ZOOM_IN: 678 case MAGNIFY_SCREEN_ZOOM_IN:
679 return HandleMagnifyScreen(1); 679 return HandleMagnifyScreen(1);
680 case MAGNIFY_SCREEN_ZOOM_OUT: 680 case MAGNIFY_SCREEN_ZOOM_OUT:
681 return HandleMagnifyScreen(-1); 681 return HandleMagnifyScreen(-1);
682 case MEDIA_NEXT_TRACK: 682 case MEDIA_NEXT_TRACK:
683 return HandleMediaNextTrack(); 683 return HandleMediaNextTrack();
684 case MEDIA_PLAY_PAUSE: 684 case MEDIA_PLAY_PAUSE:
685 return HandleMediaPlayPause(); 685 return HandleMediaPlayPause();
686 case MEDIA_PREV_TRACK: 686 case MEDIA_PREV_TRACK:
687 return HandleMediaPrevTrack(); 687 return HandleMediaPrevTrack();
688 case POWER_PRESSED: // fallthrough
689 case POWER_RELEASED:
690 // We don't do anything with these at present, but we consume them to
691 // prevent them from getting passed to apps -- see
692 // http://crbug.com/146609.
693 return true;
688 #if !defined(NDEBUG) 694 #if !defined(NDEBUG)
689 case PRINT_LAYER_HIERARCHY: 695 case PRINT_LAYER_HIERARCHY:
690 return HandlePrintLayerHierarchy(); 696 return HandlePrintLayerHierarchy();
691 case PRINT_VIEW_HIERARCHY: 697 case PRINT_VIEW_HIERARCHY:
692 return HandlePrintViewHierarchy(); 698 return HandlePrintViewHierarchy();
693 case PRINT_WINDOW_HIERARCHY: 699 case PRINT_WINDOW_HIERARCHY:
694 return HandlePrintWindowHierarchy(); 700 return HandlePrintWindowHierarchy();
695 #endif 701 #endif
696 default: 702 default:
697 NOTREACHED() << "Unhandled action " << action; 703 NOTREACHED() << "Unhandled action " << action;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 accelerators_.insert( 779 accelerators_.insert(
774 std::make_pair(accelerator, accelerators[i].action)); 780 std::make_pair(accelerator, accelerators[i].action));
775 } 781 }
776 } 782 }
777 783
778 bool AcceleratorController::CanHandleAccelerators() const { 784 bool AcceleratorController::CanHandleAccelerators() const {
779 return true; 785 return true;
780 } 786 }
781 787
782 } // namespace ash 788 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698