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

Side by Side Diff: ui/views/controls/menu/menu_controller_unittest.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "ui/aura/scoped_window_targeter.h" 8 #include "ui/aura/scoped_window_targeter.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/events/event_targeter.h" 10 #include "ui/events/event_targeter.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void DispatchEvent() { 194 void DispatchEvent() {
195 #if defined(USE_X11) 195 #if defined(USE_X11)
196 XEvent xevent; 196 XEvent xevent;
197 memset(&xevent, 0, sizeof(xevent)); 197 memset(&xevent, 0, sizeof(xevent));
198 event_source_.Dispatch(&xevent); 198 event_source_.Dispatch(&xevent);
199 #elif defined(OS_WIN) 199 #elif defined(OS_WIN)
200 MSG msg; 200 MSG msg;
201 memset(&msg, 0, sizeof(MSG)); 201 memset(&msg, 0, sizeof(MSG));
202 dispatcher_client_.dispatcher()->Dispatch(msg); 202 dispatcher_client_.dispatcher()->Dispatch(msg);
203 #elif defined(USE_OZONE) 203 #elif defined(USE_OZONE)
204 ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_SPACE, 0, true); 204 ui::KeyEvent event(' ', ui::VKEY_SPACE, ui::EF_NONE);
205 dispatcher_client_.dispatcher()->Dispatch(&event); 205 dispatcher_client_.dispatcher()->Dispatch(&event);
206 #else 206 #else
207 #error Unsupported platform 207 #error Unsupported platform
208 #endif 208 #endif
209 } 209 }
210 210
211 private: 211 private:
212 void ResetMenuController() { 212 void ResetMenuController() {
213 if (controller_) { 213 if (controller_) {
214 // These properties are faked by RunMenu for the purposes of testing and 214 // These properties are faked by RunMenu for the purposes of testing and
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 FROM_HERE, 263 FROM_HERE,
264 base::Bind(&MenuControllerTest::DispatchEscapeAndExpect, 264 base::Bind(&MenuControllerTest::DispatchEscapeAndExpect,
265 base::Unretained(this), 265 base::Unretained(this),
266 MenuController::EXIT_NONE)); 266 MenuController::EXIT_NONE));
267 RunMenu(owner.get()); 267 RunMenu(owner.get());
268 } 268 }
269 } 269 }
270 #endif 270 #endif
271 271
272 } // namespace views 272 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/combobox_unittest.cc ('k') | ui/views/controls/table/table_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698