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

Unified Diff: chrome/browser/chromeos/status/network_menu.h

Issue 7520037: [cros] Network dropdown button in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move handle click Created 9 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
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 030d79acb1c7c595dc8c951b225f71f924785561..80142e4e7b4ffb00327bb4c04c1239dcab8c9c69 100644
--- a/chrome/browser/chromeos/status/network_menu.h
+++ b/chrome/browser/chromeos/status/network_menu.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/cros/network_library.h" // ConnectionType
#include "ui/gfx/native_widget_types.h" // gfx::NativeWindow
+#include "views/controls/menu/menu_delegate.h"
#include "views/controls/menu/view_menu_delegate.h"
namespace {
@@ -29,8 +30,9 @@ class Canvas;
}
namespace views {
-class MenuItemView;
class MenuButton;
+class MenuItemInterface;
+class MenuItemView;
}
namespace chromeos {
@@ -78,7 +80,10 @@ class NetworkMenu {
virtual bool ShouldOpenButtonOptions() const = 0;
};
- NetworkMenu(Delegate* delegate, bool is_browser_mode);
+ NetworkMenu(Delegate* delegate,
+ bool is_browser_mode,
+ views::MenuItemInterface* menu_item);
+
virtual ~NetworkMenu();
// Cancels the active menu.
@@ -87,9 +92,6 @@ class NetworkMenu {
// Update the menu (e.g. when the network list or status has changed).
void UpdateMenu();
- // Run the menu.
- void RunMenu(views::View* source);
-
// Shows network details in Web UI options window.
void ShowTabbedNetworkSettings(const Network* network) const;
@@ -97,8 +99,12 @@ class NetworkMenu {
Delegate* delegate() const { return delegate_; }
bool is_browser_mode() const { return is_browser_mode_; }
- // Setters.
- void set_min_width(int min_width) { min_width_ = min_width; }
+ protected:
+ views::MenuDelegate* GetMenuDelegate();
+
+ // The network menu.
+ scoped_ptr<views::MenuItemInterface> menu_item_;
+ scoped_ptr<NetworkMenuModel> main_menu_model_;
private:
friend class NetworkMenuModel;
@@ -112,14 +118,28 @@ class NetworkMenu {
// Set to true if we are currently refreshing the menu.
bool refreshing_menu_;
- // The network menu.
- scoped_ptr<views::MenuItemView> menu_item_view_;
- scoped_ptr<NetworkMenuModel> main_menu_model_;
+ DISALLOW_COPY_AND_ASSIGN(NetworkMenu);
+};
+
+class NetworkMenuView : public NetworkMenu {
+ public:
+ NetworkMenuView(NetworkMenu::Delegate* delegate,
+ bool is_browser_mode);
+
+ virtual ~NetworkMenuView();
+
+ // Run the menu.
+ void RunMenu(views::View* source);
+
+ // Setters.
+ void set_min_width(int min_width) { min_width_ = min_width; }
+
+ private:
+ // This is a weak pointer to the MenuItemInterface implementation.
+ views::MenuItemView* menu_item_view_;
// Holds minimum width of the menu.
int min_width_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkMenu);
};
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698