| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_STATUS_AREA_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_FRAME_STATUS_AREA_VIEW_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "views/controls/menu/simple_menu_model.h" |
| 10 #include "views/controls/menu/view_menu_delegate.h" |
| 11 #include "views/view.h" |
| 12 |
| 13 class Browser; |
| 14 |
| 15 namespace views { |
| 16 class MenuButton; |
| 17 class ImageView; |
| 18 } |
| 19 |
| 20 // This class is used to wrap the small informative widgets in the upper-right |
| 21 // of the window title bar. It is used on ChromeOS only. |
| 22 class StatusAreaView : public views::View, |
| 23 public views::SimpleMenuModel::Delegate, |
| 24 public views::ViewMenuDelegate { |
| 25 public: |
| 26 StatusAreaView(Browser* browser); |
| 27 virtual ~StatusAreaView(); |
| 28 |
| 29 void Init(); |
| 30 |
| 31 // views::View* overrides. |
| 32 virtual gfx::Size GetPreferredSize(); |
| 33 virtual void Layout(); |
| 34 virtual void Paint(gfx::Canvas* canvas); |
| 35 |
| 36 private: |
| 37 void CreateAppMenu(); |
| 38 |
| 39 // views::SimpleMenuModel::Delegate implementation. |
| 40 virtual bool IsCommandIdChecked(int command_id) const; |
| 41 virtual bool IsCommandIdEnabled(int command_id) const; |
| 42 virtual bool GetAcceleratorForCommandId(int command_id, |
| 43 views::Accelerator* accelerator); |
| 44 virtual void ExecuteCommand(int command_id); |
| 45 |
| 46 // views::ViewMenuDelegate implementation. |
| 47 virtual void RunMenu(views::View* source, const gfx::Point& pt, |
| 48 gfx::NativeView hwnd); |
| 49 |
| 50 // The browser window that owns us. |
| 51 Browser* browser_; |
| 52 |
| 53 views::ImageView* battery_view_; |
| 54 views::MenuButton* menu_view_; |
| 55 |
| 56 scoped_ptr<views::SimpleMenuModel> app_menu_contents_; |
| 57 scoped_ptr<views::Menu2> app_menu_menu_; |
| 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(StatusAreaView); |
| 60 }; |
| 61 |
| 62 #endif // CHROME_BROWSER_VIEWS_FRAME_STATUS_AREA_VIEW_H_ |
| OLD | NEW |