1 // Copyright 2013 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.
5 #include "ui/base/ui_base_types.h"
7 #include "ui/events/event.h"
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;