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

Side by Side Diff: ui/views/controls/menu/menu_message_loop.h

Issue 267593005: Refactor menu controller to isolate aura dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and merge with http://crrev.com/269819 Created 6 years, 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_
7
8 #include "ui/gfx/native_widget_types.h"
9
10 namespace gfx {
11 class Point;
12 }
13
14 namespace ui {
15 class LocatedEvent;
16 }
17
18 namespace views {
19
20 class MenuController;
21 class Widget;
22
23 // Interface used by MenuController to run a nested message loop while
24 // showing a menu, allowing for platform specific implementations.
25 class MenuMessageLoop {
26 public:
27 virtual ~MenuMessageLoop() {}
28
29 // Create a platform specific instance.
30 static MenuMessageLoop* Create();
31
32 // Runs the platform specific bits of the message loop. If |nested_menu| is
33 // true we're being asked to run a menu from within a menu (eg a context
34 // menu).
35 virtual void Run(MenuController*, Widget* owner, bool nested_menu) = 0;
36
37 virtual bool ShouldQuitNow() const = 0;
sky 2014/05/15 16:07:32 Add description for functions.
Andre 2014/05/15 18:45:59 Done.
38 virtual void QuitNow() = 0;
39 virtual void RepostEventToWindow(const ui::LocatedEvent& event,
40 gfx::NativeWindow window,
41 gfx::Point screen_loc) = 0;
sky 2014/05/15 16:07:32 const gfx::Point&
Andre 2014/05/15 18:45:59 Done.
42
43 // How deep we are in nested message loops. This should be at most 2 (when
44 // showing a context menu from a menu).
45 virtual int message_loop_depth() const = 0;
sky 2014/05/15 16:07:32 Don't use unix_hacker_style for virtual methods (s
Andre 2014/05/15 18:45:59 Done. Renamed the method to GetNestedDepth(). Thi
sky 2014/05/15 19:33:01 Do you still need it once you get rid of SetOwner?
Andre 2014/05/15 20:57:12 No longer needed with the addition of ClearOwner.
46 };
47
48 } // namespace views
49
50 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698