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

Side by Side Diff: ui/base/ui_base_types.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 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 | « ui/base/ui_base_types.h ('k') | ui/message_center/views/message_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/base/ui_base_types.h"
6
7 #include "ui/base/events/event.h"
8
9 namespace ui {
10
11 MenuSourceType GetMenuSourceTypeForEvent(const ui::Event& event) {
12 ui::MenuSourceType source_type = ui::MENU_SOURCE_MOUSE;
13 if (event.IsKeyEvent())
14 source_type = ui::MENU_SOURCE_KEYBOARD;
15 if (event.IsTouchEvent() || event.IsGestureEvent())
16 source_type = ui::MENU_SOURCE_TOUCH;
17 return source_type;
18 }
19
20 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ui_base_types.h ('k') | ui/message_center/views/message_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698