diff options
author | chocobo@google.com <chocobo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 01:33:21 +0000 |
---|---|---|
committer | chocobo@google.com <chocobo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 01:33:21 +0000 |
commit | 7598ab5ec8b6b9fe6bfaaa2ee07450747fd1ee01 (patch) | |
tree | 045a49a9bd5eb156517d391ff44d46a20f947a91 /chrome/browser/chromeos/status_area_view.h | |
parent | 13555c122fbc9ec2a6c1a4cbace288ec7892be6e (diff) | |
download | chromium_src-7598ab5ec8b6b9fe6bfaaa2ee07450747fd1ee01.zip chromium_src-7598ab5ec8b6b9fe6bfaaa2ee07450747fd1ee01.tar.gz chromium_src-7598ab5ec8b6b9fe6bfaaa2ee07450747fd1ee01.tar.bz2 |
Refactor cros library code into central location and have the UI elements observe changes.
- implemented power menu button showing remaining battery info.
- implemented clock menu button showing detailed clock info.
- also implemented monitoring of network status change.
- don't show highlighted state for these menu buttons
BUG=23923
TEST=none
Review URL: http://codereview.chromium.org/251099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/status_area_view.h')
-rwxr-xr-x | chrome/browser/chromeos/status_area_view.h | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/chrome/browser/chromeos/status_area_view.h b/chrome/browser/chromeos/status_area_view.h index f2c2a1b..76f7873 100755 --- a/chrome/browser/chromeos/status_area_view.h +++ b/chrome/browser/chromeos/status_area_view.h @@ -6,18 +6,17 @@ #define CHROME_BROWSER_CHROMEOS_STATUS_AREA_VIEW_H_ #include "base/basictypes.h" -#include "third_party/cros/chromeos_cros_api.h" -#include "third_party/cros/chromeos_power.h" #include "views/controls/menu/simple_menu_model.h" #include "views/controls/menu/view_menu_delegate.h" #include "views/view.h" class Browser; +class ClockMenuButton; class NetworkMenuButton; +class PowerMenuButton; namespace views { class MenuButton; -class ImageView; } // This class is used to wrap the small informative widgets in the upper-right @@ -33,7 +32,7 @@ class StatusAreaView : public views::View, }; explicit StatusAreaView(Browser* browser); - virtual ~StatusAreaView(); + virtual ~StatusAreaView() {} void Init(); @@ -58,34 +57,20 @@ class StatusAreaView : public views::View, // views::ViewMenuDelegate implementation. virtual void RunMenu(views::View* source, const gfx::Point& pt, gfx::NativeView hwnd); - // Called whenever the battery status changes. - void PowerStatusChanged(const chromeos::PowerStatus& status); - - static void LoadCrosLibrary(); - // Called whenever the battery status changes. Dispatches to - // PowerStatusChanged() instance method. - static void PowerStatusChangedHandler( - void* object, const chromeos::PowerStatus& status); // The browser window that owns us. Browser* browser_; + ClockMenuButton* clock_view_; NetworkMenuButton* network_view_; - views::ImageView* battery_view_; + PowerMenuButton* battery_view_; views::MenuButton* menu_view_; scoped_ptr<views::SimpleMenuModel> app_menu_contents_; scoped_ptr<views::SimpleMenuModel> options_menu_contents_; scoped_ptr<views::Menu2> app_menu_menu_; - // A reference to the battery power api, to allow callbacks when the - // battery status changes. - chromeos::PowerStatusConnection power_status_connection_; static OpenTabsMode open_tabs_mode_; - // True if the library was loaded. - static bool cros_library_loaded_; - // True if there was an error loading the cros shared object. - static bool cros_library_error_; DISALLOW_COPY_AND_ASSIGN(StatusAreaView); }; |