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

Side by Side Diff: chrome/browser/chromeos/status/power_menu_button.h

Issue 8271024: chromeos: Add power supply info reading capability (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added comment about initialization dependecise Created 9 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_
6 #define CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ 6 #define CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/chromeos/cros/power_library.h" 9 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
10 #include "chrome/browser/chromeos/status/status_area_button.h" 10 #include "chrome/browser/chromeos/status/status_area_button.h"
11 #include "views/controls/menu/menu_delegate.h" 11 #include "views/controls/menu/menu_delegate.h"
12 #include "views/controls/menu/view_menu_delegate.h" 12 #include "views/controls/menu/view_menu_delegate.h"
13 13
14 namespace base { 14 namespace base {
15 class TimeDelta; 15 class TimeDelta;
16 } 16 }
17 17
18 namespace views { 18 namespace views {
19 class MenuRunner; 19 class MenuRunner;
20 } 20 }
21 21
22 class SkBitmap; 22 class SkBitmap;
23 23
24 namespace chromeos { 24 namespace chromeos {
25 25
26 // The power menu button in the status area. 26 // The power menu button in the status area.
27 // This class will handle getting the power status and populating the menu. 27 // This class will handle getting the power status and populating the menu.
28 class PowerMenuButton : public StatusAreaButton, 28 class PowerMenuButton : public StatusAreaButton,
29 public views::MenuDelegate, 29 public views::MenuDelegate,
30 public views::ViewMenuDelegate, 30 public views::ViewMenuDelegate,
31 public PowerLibrary::Observer { 31 public PowerManagerClient::Observer {
32 public: 32 public:
33 explicit PowerMenuButton(StatusAreaHost* host); 33 explicit PowerMenuButton(StatusAreaHost* host);
34 virtual ~PowerMenuButton(); 34 virtual ~PowerMenuButton();
35 35
36 // views::MenuDelegate implementation. 36 // views::MenuDelegate implementation.
37 virtual string16 GetLabel(int id) const; 37 virtual string16 GetLabel(int id) const;
38 virtual bool IsCommandEnabled(int id) const; 38 virtual bool IsCommandEnabled(int id) const;
39 39
40 // PowerLibrary::Observer implementation. 40 // PowerLibrary::Observer implementation.
41 virtual void PowerChanged(const PowerSupplyStatus& power_status); 41 virtual void PowerChanged(const PowerSupplyStatus& power_status);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // If non-null the menu is showing. 82 // If non-null the menu is showing.
83 scoped_ptr<views::MenuRunner> menu_runner_; 83 scoped_ptr<views::MenuRunner> menu_runner_;
84 84
85 DISALLOW_COPY_AND_ASSIGN(PowerMenuButton); 85 DISALLOW_COPY_AND_ASSIGN(PowerMenuButton);
86 }; 86 };
87 87
88 } // namespace chromeos 88 } // namespace chromeos
89 89
90 #endif // CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ 90 #endif // CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698