diff options
Diffstat (limited to 'views/controls/menu/native_menu_gtk.h')
-rw-r--r-- | views/controls/menu/native_menu_gtk.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h index 2c69ba3..812fbad 100644 --- a/views/controls/menu/native_menu_gtk.h +++ b/views/controls/menu/native_menu_gtk.h @@ -1,12 +1,14 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_GTK_H_ #define VIEWS_CONTROLS_MENU_NATIVE_MENU_GTK_H_ #include <gtk/gtk.h> +#include <vector> + #include "base/task.h" #include "views/controls/menu/menu_wrapper.h" @@ -36,9 +38,15 @@ class NativeMenuGtk : public MenuWrapper { virtual void Rebuild(); virtual void UpdateStates(); virtual gfx::NativeMenu GetNativeMenu() const; + virtual MenuAction GetMenuAction() const; + virtual void AddMenuListener(MenuListener* listener); + virtual void RemoveMenuListener(MenuListener* listener); private: static void OnMenuHidden(GtkWidget* widget, NativeMenuGtk* menu); + static void OnMenuMoveCurrent(GtkMenu* widget, + GtkMenuDirectionType focus_direction, + NativeMenuGtk* menu); void AddSeparatorAt(int index); GtkWidget* AddMenuItemAt(int index, GtkRadioMenuItem* radio_group, @@ -111,6 +119,12 @@ class NativeMenuGtk : public MenuWrapper { Menu2* host_menu_; gulong destroy_handler_id_; + // The action that took place during the call to RunMenuAt. + MenuAction menu_action_; + + // Vector of listeners to receive callbacks when the menu opens. + std::vector<MenuListener*> listeners_; + DISALLOW_COPY_AND_ASSIGN(NativeMenuGtk); }; |