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

Unified Diff: ui/views/controls/menu/menu_controller.h

Issue 10703145: Merge 144625 - Close any open menus on activation changes. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.h
===================================================================
--- ui/views/controls/menu/menu_controller.h (revision 146181)
+++ ui/views/controls/menu/menu_controller.h (working copy)
@@ -21,8 +21,11 @@
#include "ui/views/controls/menu/menu_item_view.h"
#if defined(USE_AURA)
+#include "ui/aura/client/activation_change_observer.h"
+
namespace aura {
class RootWindow;
+class Window;
}
#endif
@@ -48,7 +51,14 @@
// MenuController is used internally by the various menu classes to manage
// showing, selecting and drag/drop for menus. All relevant events are
// forwarded to the MenuController from SubmenuView and MenuHost.
-class VIEWS_EXPORT MenuController : public MessageLoop::Dispatcher {
+class VIEWS_EXPORT MenuController
+#if defined(USE_AURA)
+ : public MessageLoop::Dispatcher,
+ public aura::client::ActivationChangeObserver {
+#else
+ : public MessageLoop::Dispatcher {
+#endif
+
public:
// Enumeration of how the menu should exit.
enum ExitType {
@@ -126,10 +136,6 @@
void OnDragEnteredScrollButton(SubmenuView* source, bool is_up);
void OnDragExitedScrollButton(SubmenuView* source);
- // Invoked once for any Widget activation change. This allows the menu
- // to be canceled if the window manager changes the active window.
- void OnWidgetActivationChanged();
-
// Update the submenu's selection based on the current mouse location
void UpdateSubmenuSelection(SubmenuView* source);
@@ -445,6 +451,12 @@
void HandleMouseLocation(SubmenuView* source,
const gfx::Point& mouse_location);
+#if defined(USE_AURA)
+ // aura::client::ActivationChangeObserver overrides:
+ virtual void OnWindowActivated(aura::Window* active,
+ aura::Window* old_active) OVERRIDE;
+#endif
+
// The active instance.
static MenuController* active_instance_;
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698