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

Side by Side Diff: views/events/event.cc

Issue 8150001: Quick fix for NativeTextfieldViewsTest on win aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revise test expectation logic. Created 9 years, 2 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
« no previous file with comments | « views/controls/textfield/native_textfield_views_unittest.cc ('k') | views/events/event_aura.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 #include "views/events/event.h" 5 #include "views/events/event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "views/view.h" 8 #include "views/view.h"
9 #include "views/widget/root_view.h" 9 #include "views/widget/root_view.h"
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 character_(0), 81 character_(0),
82 unmodified_character_(0) { 82 unmodified_character_(0) {
83 } 83 }
84 #endif 84 #endif
85 85
86 KeyEvent::KeyEvent(ui::EventType type, 86 KeyEvent::KeyEvent(ui::EventType type,
87 ui::KeyboardCode key_code, 87 ui::KeyboardCode key_code,
88 int event_flags) 88 int event_flags)
89 : Event(type, event_flags), 89 : Event(type, event_flags),
90 key_code_(key_code), 90 key_code_(key_code),
91 character_(0), 91 character_(GetCharacterFromKeyCode(key_code, event_flags)),
92 unmodified_character_(0) { 92 unmodified_character_(0) {
93 } 93 }
94 94
95 // KeyEvent, private: --------------------------------------------------------- 95 // KeyEvent, private: ---------------------------------------------------------
96 96
97 // static 97 // static
98 uint16 KeyEvent::GetCharacterFromKeyCode(ui::KeyboardCode key_code, int flags) { 98 uint16 KeyEvent::GetCharacterFromKeyCode(ui::KeyboardCode key_code, int flags) {
99 const bool ctrl = (flags & ui::EF_CONTROL_DOWN) != 0; 99 const bool ctrl = (flags & ui::EF_CONTROL_DOWN) != 0;
100 const bool shift = (flags & ui::EF_SHIFT_DOWN) != 0; 100 const bool shift = (flags & ui::EF_SHIFT_DOWN) != 0;
101 const bool upper = shift ^ ((flags & ui::EF_CAPS_LOCK_DOWN) != 0); 101 const bool upper = shift ^ ((flags & ui::EF_CAPS_LOCK_DOWN) != 0);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 //////////////////////////////////////////////////////////////////////////////// 293 ////////////////////////////////////////////////////////////////////////////////
294 // MouseWheelEvent, public: 294 // MouseWheelEvent, public:
295 295
296 // This value matches windows WHEEL_DELTA. 296 // This value matches windows WHEEL_DELTA.
297 // static 297 // static
298 const int MouseWheelEvent::kWheelDelta = 120; 298 const int MouseWheelEvent::kWheelDelta = 120;
299 299
300 } // namespace views 300 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_views_unittest.cc ('k') | views/events/event_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698