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

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

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 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
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | ui/base/ime/chromeos/character_composer.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) 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.h" 5 #include "ui/base/accelerators/accelerator.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 : key_code_(keycode), 43 : key_code_(keycode),
44 type_(ui::ET_KEY_PRESSED), 44 type_(ui::ET_KEY_PRESSED),
45 modifiers_(modifiers), 45 modifiers_(modifiers),
46 is_repeat_(false) { 46 is_repeat_(false) {
47 } 47 }
48 48
49 Accelerator::Accelerator(const KeyEvent& key_event) 49 Accelerator::Accelerator(const KeyEvent& key_event)
50 : key_code_(key_event.key_code()), 50 : key_code_(key_event.key_code()),
51 type_(key_event.type()), 51 type_(key_event.type()),
52 modifiers_(MaskOutKeyEventFlags(key_event.flags())), 52 modifiers_(MaskOutKeyEventFlags(key_event.flags())),
53 is_repeat_(key_event.IsRepeat()) { 53 is_repeat_(key_event.is_repeat()) {
54 } 54 }
55 55
56 Accelerator::Accelerator(const Accelerator& accelerator) { 56 Accelerator::Accelerator(const Accelerator& accelerator) {
57 key_code_ = accelerator.key_code_; 57 key_code_ = accelerator.key_code_;
58 type_ = accelerator.type_; 58 type_ = accelerator.type_;
59 modifiers_ = accelerator.modifiers_; 59 modifiers_ = accelerator.modifiers_;
60 is_repeat_ = accelerator.is_repeat_; 60 is_repeat_ = accelerator.is_repeat_;
61 if (accelerator.platform_accelerator_.get()) 61 if (accelerator.platform_accelerator_.get())
62 platform_accelerator_ = accelerator.platform_accelerator_->CreateCopy(); 62 platform_accelerator_ = accelerator.platform_accelerator_->CreateCopy();
63 } 63 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 // Subtracting the size of the shortcut key and 1 for the '+' sign. 291 // Subtracting the size of the shortcut key and 1 for the '+' sign.
292 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1); 292 shortcut_rtl.append(shortcut, 0, shortcut.length() - key_length - 1);
293 shortcut.swap(shortcut_rtl); 293 shortcut.swap(shortcut_rtl);
294 } 294 }
295 295
296 return shortcut; 296 return shortcut;
297 } 297 }
298 298
299 } // namespace ui 299 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | ui/base/ime/chromeos/character_composer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698