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

Unified Diff: chrome/browser/ui/panels/panel_browser_frame_view.h

Issue 7005006: Add options menu on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/ui/panels/panel_browser_frame_view.h
===================================================================
--- chrome/browser/ui/panels/panel_browser_frame_view.h (revision 84897)
+++ chrome/browser/ui/panels/panel_browser_frame_view.h (working copy)
@@ -7,8 +7,10 @@
#pragma once
#include "base/gtest_prod_util.h"
+#include "base/scoped_ptr.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
#include "chrome/browser/ui/views/tab_icon_view.h"
+#include "ui/base/models/simple_menu_model.h"
#include "views/controls/button/button.h"
#include "views/controls/menu/view_menu_delegate.h"
@@ -16,12 +18,14 @@
namespace views {
class ImageButton;
class Label;
+class Menu2;
class MenuButton;
}
class PanelBrowserFrameView : public BrowserNonClientFrameView,
public views::ButtonListener,
public views::ViewMenuDelegate,
+ public ui::SimpleMenuModel::Delegate,
public TabIconView::TabIconViewModel {
public:
PanelBrowserFrameView(BrowserFrame* frame, PanelBrowserView* browser_view);
@@ -65,6 +69,13 @@
// Overridden from views::ViewMenuDelegate:
virtual void RunMenu(View* source, const gfx::Point& pt) OVERRIDE;
+ // Overridden from ui::SimpleMenuModel::Delegate:
+ virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
+ virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
+ virtual bool GetAcceleratorForCommandId(
+ int command_id, ui::Accelerator* accelerator) OVERRIDE;
+ virtual void ExecuteCommand(int command_id) OVERRIDE;
+
// Overridden from TabIconView::TabIconViewModel:
virtual bool ShouldTabIconViewAnimate() const OVERRIDE;
virtual SkBitmap GetFaviconForTabIconView() OVERRIDE;
@@ -72,6 +83,7 @@
private:
friend class PanelBrowserViewTest;
FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, CreatePanel);
+ FRIEND_TEST_ALL_PREFIXES(PanelBrowserViewTest, CreateOptionsMenu);
enum PaintState {
NOT_PAINTED,
@@ -79,6 +91,17 @@
PAINT_AS_ACTIVE
};
+ enum {
+ COMMAND_MINIMIZE_ALL,
+ COMMAND_RESTORE_ALL,
+ COMMAND_CLOSE_ALL,
+ COMMAND_ABOUT
+ };
+ static const int kMinimizeAllCommand = 0;
jennb 2011/05/11 18:06:10 Forgot to delete these.
jianli 2011/05/11 18:31:31 Done.
+ static const int kRestoreAllCommand = 1;
+ static const int kCloseAllCommand = 2;
+ static const int kAboutCommand = 3;
+
// Returns the thickness of the entire nonclient left, right, and bottom
// borders, including both the window frame and any client edge.
int NonClientBorderThickness() const;
@@ -95,6 +118,9 @@
void PaintFrameBorder(gfx::Canvas* canvas);
void PaintClientEdge(gfx::Canvas* canvas);
+ void CreateOptionsMenu();
+ void CreateOptionsMenuItems();
+
// The frame that hosts this view. This is a weak reference such that frame_
// will always be valid in the lifetime of this view.
BrowserFrame* frame_;
@@ -111,6 +137,8 @@
views::Label* title_label_;
gfx::Rect client_view_bounds_;
std::wstring accessible_name_;
+ scoped_ptr<views::Menu2> options_menu_;
+ scoped_ptr<ui::SimpleMenuModel> options_menu_contents_;
DISALLOW_COPY_AND_ASSIGN(PanelBrowserFrameView);
};

Powered by Google App Engine
This is Rietveld 408576698