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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/power_handler.h

Issue 677983004: Power overlay in Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
(Empty)
1 // Copyright 2014 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_UI_WEBUI_OPTIONS_CHROMEOS_POWER_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_POWER_HANDLER_H_
7
8 #include "ash/system/chromeos/power/power_status.h"
9 #include "base/macros.h"
10 #include "base/strings/string16.h"
11 #include "chrome/browser/ui/webui/options/options_ui.h"
12
13 namespace chromeos {
14 namespace options {
15
16 // Shows battery status and power settings.
17 class PowerHandler : public ::options::OptionsPageUIHandler,
18 public ash::PowerStatus::Observer {
19 public:
20 PowerHandler();
21 ~PowerHandler() override;
22
23 // OptionsPageUIHandler implementation.
24 void GetLocalizedValues(base::DictionaryValue* localized_strings) override;
25 void InitializePage() override;
26 void RegisterMessages() override;
27
28 // ash::PowerStatus::Observer implementation.
29 void OnPowerStatusChanged() override;
30
31 private:
32 // Gets the battery status text, showing the percentage and time remaining if
33 // calculated. Returns an empty string if there is no battery.
34 base::string16 GetStatusValue() const;
35
36 // Helper function to get the battery status text, including the 'Battery'
37 // label at the beginning. Wraps GetStatusValue(). Returns an empty string if
38 // there is no battery.
39 base::string16 GetFullStatusText() const;
40
41 // Handler for the battery icon request.
42 void GetBatteryIcon(const base::ListValue* args);
43
44 DISALLOW_COPY_AND_ASSIGN(PowerHandler);
45 };
46
47 } // namespace options
48 } // namespace chromeos
49
50 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_POWER_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/browser/ui/webui/options/chromeos/power_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698