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

Side by Side Diff: ui/base/accelerators/accelerator.h

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Created 5 years, 11 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
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 // This class describe a keyboard accelerator (or keyboard shortcut). 5 // This class describe a keyboard accelerator (or keyboard shortcut).
6 // Keyboard accelerators are registered with the FocusManager. 6 // Keyboard accelerators are registered with the FocusManager.
7 // It has a copy constructor and assignment operator so that it can be copied. 7 // It has a copy constructor and assignment operator so that it can be copied.
8 // It also defines the < operator so that it can be used as a key in a std::map. 8 // It also defines the < operator so that it can be used as a key in a std::map.
9 // 9 //
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 public: 110 public:
111 // Gets the accelerator for the specified command id. Returns true if the 111 // Gets the accelerator for the specified command id. Returns true if the
112 // command id has a valid accelerator, false otherwise. 112 // command id has a valid accelerator, false otherwise.
113 virtual bool GetAcceleratorForCommandId(int command_id, 113 virtual bool GetAcceleratorForCommandId(int command_id,
114 ui::Accelerator* accelerator) = 0; 114 ui::Accelerator* accelerator) = 0;
115 115
116 protected: 116 protected:
117 virtual ~AcceleratorProvider() {} 117 virtual ~AcceleratorProvider() {}
118 }; 118 };
119 119
120 // An interface for dispatching accelerators to AcceleratorTargets.
121 class UI_BASE_EXPORT AcceleratorProcessor {
sky 2015/01/08 23:39:26 Is there a reason this isn't in its own header?
Andre 2015/01/09 00:06:15 Done, moved to its own header.
122 public:
123 // Activate the target associated with the specified accelerator.
124 // First, AcceleratorPressed handler of the most recently registered target
125 // is called, and if that handler processes the event (i.e. returns true),
126 // this method immediately returns. If not, we do the same thing on the next
127 // target, and so on.
128 // Returns true if an accelerator was activated.
129 virtual bool ProcessAccelerator(const Accelerator& accelerator) = 0;
130
131 // Returns the AcceleratorTarget that should be activated for the specified
132 // keyboard accelerator, or NULL if no view is registered for that keyboard
sky 2015/01/08 23:39:26 view->target
Andre 2015/01/09 00:06:15 Done.
133 // accelerator.
134 virtual AcceleratorTarget* GetTargetForAccelerator(
135 const Accelerator& accelerator) const = 0;
136
137 protected:
138 virtual ~AcceleratorProcessor() {}
139 };
140
120 } // namespace ui 141 } // namespace ui
121 142
122 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_ 143 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698