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_; |