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

Side by Side Diff: ui/aura_shell/shell.h

Issue 8465021: Add ShellAcceleratorController that managers global keyboard accelerators. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address tfarina's 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 | « ui/aura_shell/desktop_event_filter.cc ('k') | ui/aura_shell/shell.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) 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_SHELL_SHELL_H_ 5 #ifndef UI_AURA_SHELL_SHELL_H_
6 #define UI_AURA_SHELL_SHELL_H_ 6 #define UI_AURA_SHELL_SHELL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/task.h" 14 #include "base/task.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "ui/aura_shell/aura_shell_export.h" 17 #include "ui/aura_shell/aura_shell_export.h"
18 18
19 namespace aura { 19 namespace aura {
20 class EventFilter; 20 class EventFilter;
21 class Window; 21 class Window;
22 } 22 }
23 namespace gfx { 23 namespace gfx {
24 class Rect; 24 class Rect;
25 } 25 }
26 26
27 namespace aura_shell { 27 namespace aura_shell {
28 28
29 class Launcher; 29 class Launcher;
30 class ShellAcceleratorController;
30 class ShellDelegate; 31 class ShellDelegate;
31 32
32 namespace internal { 33 namespace internal {
33 class ShelfLayoutController; 34 class ShelfLayoutController;
34 class WorkspaceController; 35 class WorkspaceController;
35 } 36 }
36 37
37 // Shell is a singleton object that presents the Shell API and implements the 38 // Shell is a singleton object that presents the Shell API and implements the
38 // Desktop's delegate interface. 39 // Desktop's delegate interface.
39 class AURA_SHELL_EXPORT Shell { 40 class AURA_SHELL_EXPORT Shell {
(...skipping 13 matching lines...) Expand all
53 aura::Window* GetContainer(int container_id); 54 aura::Window* GetContainer(int container_id);
54 const aura::Window* GetContainer(int container_id) const; 55 const aura::Window* GetContainer(int container_id) const;
55 56
56 // Adds or removes |filter| from the DesktopEventFilter. 57 // Adds or removes |filter| from the DesktopEventFilter.
57 void AddDesktopEventFilter(aura::EventFilter* filter); 58 void AddDesktopEventFilter(aura::EventFilter* filter);
58 void RemoveDesktopEventFilter(aura::EventFilter* filter); 59 void RemoveDesktopEventFilter(aura::EventFilter* filter);
59 60
60 // Toggles between overview mode and normal mode. 61 // Toggles between overview mode and normal mode.
61 void ToggleOverview(); 62 void ToggleOverview();
62 63
64 ShellAcceleratorController* accelerator_controller() {
65 return accelerator_controller_.get();
66 }
63 ShellDelegate* delegate() { return delegate_.get(); } 67 ShellDelegate* delegate() { return delegate_.get(); }
64 Launcher* launcher() { return launcher_.get(); } 68 Launcher* launcher() { return launcher_.get(); }
65 69
66 private: 70 private:
67 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair; 71 typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
68 72
69 explicit Shell(ShellDelegate* delegate); 73 explicit Shell(ShellDelegate* delegate);
70 virtual ~Shell(); 74 virtual ~Shell();
71 75
72 void Init(); 76 void Init();
73 77
74 // Enables WorkspaceManager. 78 // Enables WorkspaceManager.
75 void EnableWorkspaceManager(); 79 void EnableWorkspaceManager();
76 80
77 static Shell* instance_; 81 static Shell* instance_;
78 82
79 std::vector<WindowAndBoundsPair> to_restore_; 83 std::vector<WindowAndBoundsPair> to_restore_;
80 84
81 base::WeakPtrFactory<Shell> method_factory_; 85 base::WeakPtrFactory<Shell> method_factory_;
82 86
87 scoped_ptr<ShellAcceleratorController> accelerator_controller_;
88
83 scoped_ptr<ShellDelegate> delegate_; 89 scoped_ptr<ShellDelegate> delegate_;
84 90
85 scoped_ptr<Launcher> launcher_; 91 scoped_ptr<Launcher> launcher_;
86 92
87 scoped_ptr<internal::WorkspaceController> workspace_controller_; 93 scoped_ptr<internal::WorkspaceController> workspace_controller_;
88 scoped_ptr<internal::ShelfLayoutController> shelf_layout_controller_; 94 scoped_ptr<internal::ShelfLayoutController> shelf_layout_controller_;
89 95
90 DISALLOW_COPY_AND_ASSIGN(Shell); 96 DISALLOW_COPY_AND_ASSIGN(Shell);
91 }; 97 };
92 98
93 } // namespace aura_shell 99 } // namespace aura_shell
94 100
95 #endif // UI_AURA_SHELL_SHELL_H_ 101 #endif // UI_AURA_SHELL_SHELL_H_
OLDNEW
« no previous file with comments | « ui/aura_shell/desktop_event_filter.cc ('k') | ui/aura_shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698