Index: chrome/browser/chromeos/status/network_menu.h |
diff --git a/chrome/browser/chromeos/status/network_menu.h b/chrome/browser/chromeos/status/network_menu.h |
index 13ad95b2b928ef1371f118994b9bc11f8265e7ba..6f2db0bec2b59eca4361cb34e048daca3ca24e56 100644 |
--- a/chrome/browser/chromeos/status/network_menu.h |
+++ b/chrome/browser/chromeos/status/network_menu.h |
@@ -9,20 +9,19 @@ |
#include <string> |
#include <vector> |
+#include "base/compiler_specific.h" |
#include "chrome/browser/chromeos/options/network_config_view.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
-#include "ui/base/models/simple_menu_model.h" |
+#include "ui/base/models/menu_model.h" |
#include "ui/gfx/native_widget_types.h" |
+#include "views/controls/button/menu_button.h" |
+#include "views/controls/menu/menu_delegate.h" |
#include "views/controls/menu/view_menu_delegate.h" |
namespace gfx { |
class Canvas; |
} |
-namespace views { |
-class Menu2; |
-} |
- |
namespace chromeos { |
// Menu for network menu button in the status area/welcome screen. |
@@ -48,8 +47,8 @@ namespace chromeos { |
// |
// <icon> will show the strength of the wifi/cellular networks. |
// The label will be BOLD if the network is currently connected. |
-class NetworkMenu : public views::ViewMenuDelegate, |
- public ui::MenuModel { |
+class NetworkMenu : public views::MenuDelegate, |
+ public views::ViewMenuDelegate { |
public: |
struct NetworkInfo { |
NetworkInfo() : |
@@ -83,28 +82,12 @@ class NetworkMenu : public views::ViewMenuDelegate, |
const std::string& ssid, |
int remember) const; |
- // ui::MenuModel implementation. |
- virtual bool HasIcons() const { return true; } |
- virtual int GetItemCount() const; |
- virtual ui::MenuModel::ItemType GetTypeAt(int index) const; |
- virtual int GetCommandIdAt(int index) const { return index; } |
- virtual string16 GetLabelAt(int index) const; |
- virtual bool IsItemDynamicAt(int index) const { return true; } |
- virtual const gfx::Font* GetLabelFontAt(int index) const; |
- virtual bool GetAcceleratorAt(int index, |
- ui::Accelerator* accelerator) const { return false; } |
- virtual bool IsItemCheckedAt(int index) const; |
- virtual int GetGroupIdAt(int index) const { return 0; } |
- virtual bool GetIconAt(int index, SkBitmap* icon); |
- virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { |
- return NULL; |
- } |
- virtual bool IsEnabledAt(int index) const; |
- virtual ui::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } |
- virtual void HighlightChangedTo(int index) {} |
- virtual void ActivatedAt(int index); |
- virtual void MenuWillShow() {} |
- virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate) {} |
+ // views::MenuDelegate implementation |
+ virtual std::wstring GetLabel(int id) const OVERRIDE; |
+ virtual const gfx::Font* GetLabelFont(int id) const OVERRIDE; |
+ virtual bool IsItemChecked(int id) const OVERRIDE; |
+ virtual bool IsCommandEnabled(int id) const OVERRIDE; |
+ virtual void ExecuteCommand(int id) OVERRIDE; |
void SetFirstLevelMenuWidth(int width); |
@@ -157,6 +140,7 @@ class NetworkMenu : public views::ViewMenuDelegate, |
protected: |
virtual bool IsBrowserMode() const = 0; |
+ virtual views::MenuButton* GetMenuButton() = 0; |
oshima
2011/04/15 17:40:12
where are we using this?
rhashimoto
2011/04/15 21:20:27
NetworkMenu is a superclass for NetworkMenuButton
|
virtual gfx::NativeWindow GetNativeWindow() const = 0; |
virtual void OpenButtonOptions() = 0; |
virtual bool ShouldOpenButtonOptions() const = 0; |
@@ -243,7 +227,7 @@ class NetworkMenu : public views::ViewMenuDelegate, |
MenuItemVector menu_items_; |
// The network menu. |
- scoped_ptr<views::Menu2> network_menu_; |
+ scoped_ptr<views::MenuItemView> network_menu_; |
// Holds minimum width or -1 if it wasn't set up. |
int min_width_; |