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

Side by Side Diff: ui/content_accelerators/accelerator_util.cc

Issue 2751323002: Converts ui::Accelerator::type to an enum (Closed)
Patch Set: remove dcheck Created 3 years, 9 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 #include "ui/content_accelerators/accelerator_util.h" 5 #include "ui/content_accelerators/accelerator_util.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "third_party/WebKit/public/platform/WebInputEvent.h" 8 #include "third_party/WebKit/public/platform/WebInputEvent.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_constants.h" 10 #include "ui/events/event_constants.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 } // namespace 36 } // namespace
37 37
38 ui::Accelerator GetAcceleratorFromNativeWebKeyboardEvent( 38 ui::Accelerator GetAcceleratorFromNativeWebKeyboardEvent(
39 const content::NativeWebKeyboardEvent& event) { 39 const content::NativeWebKeyboardEvent& event) {
40 ui::Accelerator accelerator( 40 ui::Accelerator accelerator(
41 static_cast<ui::KeyboardCode>(event.windowsKeyCode), 41 static_cast<ui::KeyboardCode>(event.windowsKeyCode),
42 GetModifiersFromNativeWebKeyboardEvent(event)); 42 GetModifiersFromNativeWebKeyboardEvent(event));
43 if (event.type() == blink::WebInputEvent::KeyUp) 43 if (event.type() == blink::WebInputEvent::KeyUp)
44 accelerator.set_type(ui::ET_KEY_RELEASED); 44 accelerator.set_key_state(Accelerator::KeyState::RELEASED);
45 return accelerator; 45 return accelerator;
46 } 46 }
47 47
48 } // namespace ui 48 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698