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

Side by Side Diff: chrome/browser/chromeos/dbus/power_manager_client.cc

Issue 8480033: CrOs: Remove 29 exit time destructors and 8 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reupload 2 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 | Annotate | Revision Log
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 #include "chrome/browser/chromeos/dbus/power_manager_client.h" 5 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 14 matching lines...) Expand all
25 PowerSupplyStatus::PowerSupplyStatus() 25 PowerSupplyStatus::PowerSupplyStatus()
26 : line_power_on(false), 26 : line_power_on(false),
27 battery_is_present(false), 27 battery_is_present(false),
28 battery_is_full(false), 28 battery_is_full(false),
29 battery_seconds_to_empty(0), 29 battery_seconds_to_empty(0),
30 battery_seconds_to_full(0), 30 battery_seconds_to_full(0),
31 battery_percentage(0) { 31 battery_percentage(0) {
32 } 32 }
33 33
34 const std::string& PowerSupplyStatus::ToString() const { 34 const std::string& PowerSupplyStatus::ToString() const {
35 static std::string result = ""; 35 // TODO(thakis): This looks weird. This should probably not be static, and
36 // the function should just return a string by value.
37 CR_DEFINE_STATIC_LOCAL(std::string, result, ());
36 base::StringAppendF(&result, 38 base::StringAppendF(&result,
37 "line_power_on = %s ", 39 "line_power_on = %s ",
38 line_power_on ? "true" : "false"); 40 line_power_on ? "true" : "false");
39 base::StringAppendF(&result, 41 base::StringAppendF(&result,
40 "battery_is_present = %s ", 42 "battery_is_present = %s ",
41 battery_is_present ? "true" : "false"); 43 battery_is_present ? "true" : "false");
42 base::StringAppendF(&result, 44 base::StringAppendF(&result,
43 "battery_is_full = %s ", 45 "battery_is_full = %s ",
44 battery_is_full ? "true" : "false"); 46 battery_is_full ? "true" : "false");
45 base::StringAppendF(&result, 47 base::StringAppendF(&result,
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 377
376 PowerManagerClient* PowerManagerClient::Create(dbus::Bus* bus) { 378 PowerManagerClient* PowerManagerClient::Create(dbus::Bus* bus) {
377 if (system::runtime_environment::IsRunningOnChromeOS()) { 379 if (system::runtime_environment::IsRunningOnChromeOS()) {
378 return new PowerManagerClientImpl(bus); 380 return new PowerManagerClientImpl(bus);
379 } else { 381 } else {
380 return new PowerManagerClientStubImpl(); 382 return new PowerManagerClientStubImpl();
381 } 383 }
382 } 384 }
383 385
384 } // namespace chromeos 386 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/onc_network_parser.cc ('k') | chrome/browser/chromeos/login/registration_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698