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

Side by Side Diff: ui/base/accelerators/accelerator_manager.cc

Issue 10155015: Process all global shortcuts for Ash after InputMethodEventFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 8 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
« ash/accelerators/accelerator_table.cc ('K') | « ash/shell.cc ('k') | no next file » | 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 "ui/base/accelerators/accelerator_manager.h" 5 #include "ui/base/accelerators/accelerator_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Check if we have a priority handler. If not, there's no more work needed. 112 // Check if we have a priority handler. If not, there's no more work needed.
113 if (!map_iter->second.first) 113 if (!map_iter->second.first)
114 return false; 114 return false;
115 115
116 // If the priority handler says it cannot handle the accelerator, we must not 116 // If the priority handler says it cannot handle the accelerator, we must not
117 // count it as one. 117 // count it as one.
118 return map_iter->second.second.front()->CanHandleAccelerators(); 118 return map_iter->second.second.front()->CanHandleAccelerators();
119 } 119 }
120 120
121 bool AcceleratorManager::ShouldHandle(const Accelerator& accelerator) const { 121 bool AcceleratorManager::ShouldHandle(const Accelerator& accelerator) const {
122 if (accelerator.type() != ET_KEY_RELEASED && 122 if (accelerator.type() != ET_KEY_RELEASED)
123 accelerator.type() != ET_TRANSLATED_KEY_RELEASE) {
124 return true; 123 return true;
125 } 124
126 // This check is necessary e.g. not to process the Shift+Alt+ET_KEY_RELEASED 125 // This check is necessary e.g. not to process the Shift+Alt+ET_KEY_RELEASED
127 // Accelerator for Chrome OS (see ash/accelerators/accelerator_controller.cc) 126 // Accelerator for Chrome OS (see ash/accelerators/accelerator_controller.cc)
128 // when Shift+Alt+Tab is pressed and then Tab is released. 127 // when Shift+Alt+Tab is pressed and then Tab is released.
129 if (last_event_type_ == ET_KEY_PRESSED || 128 return last_event_type_ == ET_KEY_PRESSED;
130 last_event_type_ == ET_TRANSLATED_KEY_PRESS) {
131 return true;
132 }
133 return false;
134 } 129 }
135 130
136 } // namespace ui 131 } // namespace ui
OLDNEW
« ash/accelerators/accelerator_table.cc ('K') | « ash/shell.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698