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

Side by Side Diff: ui/aura/desktop.h

Issue 8465021: Add ShellAcceleratorController that managers global keyboard accelerators. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address comments Created 9 years, 1 month 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 | ui/aura/desktop.cc » ('j') | ui/aura/desktop.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_AURA_DESKTOP_H_ 5 #ifndef UI_AURA_DESKTOP_H_
6 #define UI_AURA_DESKTOP_H_ 6 #define UI_AURA_DESKTOP_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "ui/aura/aura_export.h" 14 #include "ui/aura/aura_export.h"
15 #include "ui/aura/cursor.h" 15 #include "ui/aura/cursor.h"
16 #include "ui/aura/focus_manager.h" 16 #include "ui/aura/focus_manager.h"
17 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
18 #include "ui/base/events.h" 18 #include "ui/base/events.h"
19 #include "ui/base/models/accelerator.h"
19 #include "ui/gfx/compositor/compositor.h" 20 #include "ui/gfx/compositor/compositor.h"
20 #include "ui/gfx/compositor/layer_animation_observer.h" 21 #include "ui/gfx/compositor/layer_animation_observer.h"
21 #include "ui/gfx/native_widget_types.h" 22 #include "ui/gfx/native_widget_types.h"
22 #include "ui/gfx/point.h" 23 #include "ui/gfx/point.h"
23 24
24 namespace gfx { 25 namespace gfx {
25 class Size; 26 class Size;
26 } 27 }
27 28
28 namespace ui { 29 namespace ui {
30 class AcceleratorManager;
29 class LayerAnimationSequence; 31 class LayerAnimationSequence;
30 class Transform; 32 class Transform;
31 } 33 }
32 34
33 namespace aura { 35 namespace aura {
34 36
35 class DesktopHost; 37 class DesktopHost;
36 class DesktopObserver; 38 class DesktopObserver;
37 class KeyEvent; 39 class KeyEvent;
38 class MouseEvent; 40 class MouseEvent;
39 class ScreenAura; 41 class ScreenAura;
40 class StackingClient; 42 class StackingClient;
41 class TouchEvent; 43 class TouchEvent;
42 44
43 // Desktop is responsible for hosting a set of windows. 45 // Desktop is responsible for hosting a set of windows.
44 class AURA_EXPORT Desktop : public ui::CompositorDelegate, 46 class AURA_EXPORT Desktop : public ui::CompositorDelegate,
45 public Window, 47 public Window,
46 public internal::FocusManager, 48 public internal::FocusManager,
47 public ui::LayerAnimationObserver { 49 public ui::LayerAnimationObserver,
50 public ui::AcceleratorTarget {
48 public: 51 public:
49 Desktop(); 52 Desktop();
50 virtual ~Desktop(); 53 virtual ~Desktop();
51 54
52 static Desktop* GetInstance(); 55 static Desktop* GetInstance();
53 static void DeleteInstanceForTesting(); 56 static void DeleteInstanceForTesting();
54 57
55 static void set_use_fullscreen_host_window(bool use_fullscreen) { 58 static void set_use_fullscreen_host_window(bool use_fullscreen) {
56 use_fullscreen_host_window_ = use_fullscreen; 59 use_fullscreen_host_window_ = use_fullscreen;
57 } 60 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // an event by |Dispatch(const NativeEvent&)| on it. It must never be stored. 121 // an event by |Dispatch(const NativeEvent&)| on it. It must never be stored.
119 MessageLoop::Dispatcher* GetDispatcher(); 122 MessageLoop::Dispatcher* GetDispatcher();
120 123
121 // Add/remove observer. 124 // Add/remove observer.
122 void AddObserver(DesktopObserver* observer); 125 void AddObserver(DesktopObserver* observer);
123 void RemoveObserver(DesktopObserver* observer); 126 void RemoveObserver(DesktopObserver* observer);
124 127
125 // Are any mouse buttons currently down? 128 // Are any mouse buttons currently down?
126 bool IsMouseButtonDown() const; 129 bool IsMouseButtonDown() const;
127 130
131 // Register accelerators for the desktop.
132 void RegisterAccelerators(ui::AcceleratorManager* accelerator_manager);
133
134 // Overridden from ui::AcceleratorTarget.
Ben Goodger (Google) 2011/11/15 16:28:09 : on the end, rather than .
mazda 2011/11/16 05:40:08 Done.
135 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
136
128 // Capture ------------------------------------------------------------------- 137 // Capture -------------------------------------------------------------------
129 138
130 // Sets capture to the specified window. 139 // Sets capture to the specified window.
131 void SetCapture(Window* window); 140 void SetCapture(Window* window);
132 141
133 // If |window| has mouse capture, the current capture window is set to NULL. 142 // If |window| has mouse capture, the current capture window is set to NULL.
134 void ReleaseCapture(Window* window); 143 void ReleaseCapture(Window* window);
135 144
136 // Overridden from Window: 145 // Overridden from Window:
137 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; 146 virtual void SetTransform(const ui::Transform& transform) OVERRIDE;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 Window* mouse_moved_handler_; 226 Window* mouse_moved_handler_;
218 Window* focused_window_; 227 Window* focused_window_;
219 Window* touch_event_handler_; 228 Window* touch_event_handler_;
220 229
221 DISALLOW_COPY_AND_ASSIGN(Desktop); 230 DISALLOW_COPY_AND_ASSIGN(Desktop);
222 }; 231 };
223 232
224 } // namespace aura 233 } // namespace aura
225 234
226 #endif // UI_AURA_DESKTOP_H_ 235 #endif // UI_AURA_DESKTOP_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/desktop.cc » ('j') | ui/aura/desktop.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698