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

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

Issue 11047030: Decouple EventClientImpl and root window. Check containers on the same root window as focused windo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix type in event_filter_unittest Created 8 years, 2 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 15 matching lines...) Expand all
26 #include "ash/screenshot_delegate.h" 26 #include "ash/screenshot_delegate.h"
27 #include "ash/shell.h" 27 #include "ash/shell.h"
28 #include "ash/shell_delegate.h" 28 #include "ash/shell_delegate.h"
29 #include "ash/shell_window_ids.h" 29 #include "ash/shell_window_ids.h"
30 #include "ash/system/brightness/brightness_control_delegate.h" 30 #include "ash/system/brightness/brightness_control_delegate.h"
31 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" 31 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h"
32 #include "ash/system/tray/system_tray.h" 32 #include "ash/system/tray/system_tray.h"
33 #include "ash/system/tray/system_tray_delegate.h" 33 #include "ash/system/tray/system_tray_delegate.h"
34 #include "ash/volume_control_delegate.h" 34 #include "ash/volume_control_delegate.h"
35 #include "ash/wm/partial_screenshot_view.h" 35 #include "ash/wm/partial_screenshot_view.h"
36 #include "ash/wm/power_button_controller.h"
36 #include "ash/wm/property_util.h" 37 #include "ash/wm/property_util.h"
37 #include "ash/wm/window_cycle_controller.h" 38 #include "ash/wm/window_cycle_controller.h"
38 #include "ash/wm/window_util.h" 39 #include "ash/wm/window_util.h"
39 #include "ash/wm/workspace/snap_sizer.h" 40 #include "ash/wm/workspace/snap_sizer.h"
40 #include "base/bind.h" 41 #include "base/bind.h"
41 #include "base/command_line.h" 42 #include "base/command_line.h"
42 #include "ui/aura/env.h" 43 #include "ui/aura/env.h"
43 #include "ui/aura/root_window.h" 44 #include "ui/aura/root_window.h"
44 #include "ui/base/accelerators/accelerator.h" 45 #include "ui/base/accelerators/accelerator.h"
45 #include "ui/base/accelerators/accelerator_manager.h" 46 #include "ui/base/accelerators/accelerator_manager.h"
46 #include "ui/base/events/event.h" 47 #include "ui/base/events/event.h"
47 #include "ui/base/keycodes/keyboard_codes.h" 48 #include "ui/base/keycodes/keyboard_codes.h"
48 #include "ui/compositor/debug_utils.h" 49 #include "ui/compositor/debug_utils.h"
49 #include "ui/compositor/layer.h" 50 #include "ui/compositor/layer.h"
50 #include "ui/compositor/layer_animation_sequence.h" 51 #include "ui/compositor/layer_animation_sequence.h"
51 #include "ui/compositor/layer_animator.h" 52 #include "ui/compositor/layer_animator.h"
52 #include "ui/gfx/screen.h" 53 #include "ui/gfx/screen.h"
53 #include "ui/oak/oak.h" 54 #include "ui/oak/oak.h"
54 #include "ui/views/debug_utils.h" 55 #include "ui/views/debug_utils.h"
55 #include "ui/views/widget/widget.h" 56 #include "ui/views/widget/widget.h"
56 57
57 #if defined(OS_CHROMEOS) 58 #if defined(OS_CHROMEOS)
58 #include "ash/display/output_configurator_animation.h" 59 #include "ash/display/output_configurator_animation.h"
59 #include "base/chromeos/chromeos_version.h" 60 #include "base/chromeos/chromeos_version.h"
61 #include "base/time.h"
60 #include "chromeos/display/output_configurator.h" 62 #include "chromeos/display/output_configurator.h"
61 #endif // defined(OS_CHROMEOS) 63 #endif // defined(OS_CHROMEOS)
62 64
63 namespace ash { 65 namespace ash {
64 namespace { 66 namespace {
65 67
66 // Factor of magnification scale. For example, when this value is 1.189, scale 68 // Factor of magnification scale. For example, when this value is 1.189, scale
67 // value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ... 69 // value will be changed x1.000, x1.189, x1.414, x1.681, x2.000, ...
68 // Note: this value is 2.0 ^ (1 / 4). 70 // Note: this value is 2.0 ^ (1 / 4).
69 const float kMagnificationFactor = 1.18920712f; 71 const float kMagnificationFactor = 1.18920712f;
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 case MAGNIFY_SCREEN_ZOOM_OUT: 758 case MAGNIFY_SCREEN_ZOOM_OUT:
757 return HandleMagnifyScreen(-1); 759 return HandleMagnifyScreen(-1);
758 case MEDIA_NEXT_TRACK: 760 case MEDIA_NEXT_TRACK:
759 return HandleMediaNextTrack(); 761 return HandleMediaNextTrack();
760 case MEDIA_PLAY_PAUSE: 762 case MEDIA_PLAY_PAUSE:
761 return HandleMediaPlayPause(); 763 return HandleMediaPlayPause();
762 case MEDIA_PREV_TRACK: 764 case MEDIA_PREV_TRACK:
763 return HandleMediaPrevTrack(); 765 return HandleMediaPrevTrack();
764 case POWER_PRESSED: // fallthrough 766 case POWER_PRESSED: // fallthrough
765 case POWER_RELEASED: 767 case POWER_RELEASED:
766 // We don't do anything with these at present, but we consume them to 768 #if defined(OS_CHROMEOS)
767 // prevent them from getting passed to apps -- see 769 if (!base::chromeos::IsRunningOnChromeOS()) {
768 // http://crbug.com/146609. 770 // There is no powerd in linux desktop, so call the
769 return true; 771 // PowerButtonController here.
772 Shell::GetInstance()->power_button_controller()->
773 OnPowerButtonEvent(action == POWER_PRESSED, base::TimeTicks());
774 }
775 #endif
776 // We don't do anything with these at present on the device,
777 // (power button evets are reported to us from powerm via
778 // D-BUS), but we consume them to prevent them from getting
779 // passed to apps -- see http://crbug.com/146609.
780 return true;
781 case LOCK_PRESSED:
782 case LOCK_RELEASED:
783 #if defined(OS_CHROMEOS)
784 if (!base::chromeos::IsRunningOnChromeOS()) {
785 // There is no powerd in linux desktop, so call the
786 // PowerButtonController here.
787 Shell::GetInstance()->power_button_controller()->
788 OnLockButtonEvent(action == LOCK_PRESSED, base::TimeTicks());
789 return true;
790 }
791 #endif
792 // LOCK_PRESSED/RELEASED in debug only action that is meant for
793 // testing lock behavior on linux desktop. If we ever reached
794 // here (when you run a debug build on the device), pass it onto
795 // apps.
796 return false;
770 #if !defined(NDEBUG) 797 #if !defined(NDEBUG)
771 case PRINT_LAYER_HIERARCHY: 798 case PRINT_LAYER_HIERARCHY:
772 return HandlePrintLayerHierarchy(); 799 return HandlePrintLayerHierarchy();
773 case PRINT_VIEW_HIERARCHY: 800 case PRINT_VIEW_HIERARCHY:
774 return HandlePrintViewHierarchy(); 801 return HandlePrintViewHierarchy();
775 case PRINT_WINDOW_HIERARCHY: 802 case PRINT_WINDOW_HIERARCHY:
776 return HandlePrintWindowHierarchy(); 803 return HandlePrintWindowHierarchy();
777 #endif 804 #endif
778 default: 805 default:
779 NOTREACHED() << "Unhandled action " << action; 806 NOTREACHED() << "Unhandled action " << action;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 accelerators_.insert( 888 accelerators_.insert(
862 std::make_pair(accelerator, accelerators[i].action)); 889 std::make_pair(accelerator, accelerators[i].action));
863 } 890 }
864 } 891 }
865 892
866 bool AcceleratorController::CanHandleAccelerators() const { 893 bool AcceleratorController::CanHandleAccelerators() const {
867 return true; 894 return true;
868 } 895 }
869 896
870 } // namespace ash 897 } // 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