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

Side by Side Diff: chromeos/dbus/power_policy_controller.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/dbus/power_policy_controller.h" 5 #include "chromeos/dbus/power_policy_controller.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (policy.has_user_activity_screen_dim_delay_factor()) { 122 if (policy.has_user_activity_screen_dim_delay_factor()) {
123 str += base::StringPrintf("user_activity_screen_dim_delay_factor=%f ", 123 str += base::StringPrintf("user_activity_screen_dim_delay_factor=%f ",
124 policy.user_activity_screen_dim_delay_factor()); 124 policy.user_activity_screen_dim_delay_factor());
125 } 125 }
126 if (policy.has_wait_for_initial_user_activity()) { 126 if (policy.has_wait_for_initial_user_activity()) {
127 str += base::StringPrintf("wait_for_initial_user_activity=%d ", 127 str += base::StringPrintf("wait_for_initial_user_activity=%d ",
128 policy.wait_for_initial_user_activity()); 128 policy.wait_for_initial_user_activity());
129 } 129 }
130 if (policy.has_reason()) 130 if (policy.has_reason())
131 str += base::StringPrintf("reason=\"%s\" ", policy.reason().c_str()); 131 str += base::StringPrintf("reason=\"%s\" ", policy.reason().c_str());
132 TrimWhitespace(str, TRIM_TRAILING, &str); 132 base::TrimWhitespace(str, base::TRIM_TRAILING, &str);
133 return str; 133 return str;
134 } 134 }
135 135
136 PowerPolicyController::PowerPolicyController() 136 PowerPolicyController::PowerPolicyController()
137 : client_(NULL), 137 : client_(NULL),
138 prefs_were_set_(false), 138 prefs_were_set_(false),
139 honor_screen_wake_locks_(true), 139 honor_screen_wake_locks_(true),
140 next_wake_lock_id_(1) { 140 next_wake_lock_id_(1) {
141 } 141 }
142 142
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 it != system_wake_locks_.end(); ++it) { 273 it != system_wake_locks_.end(); ++it) {
274 reason += (reason.empty() ? "" : ", ") + it->second; 274 reason += (reason.empty() ? "" : ", ") + it->second;
275 } 275 }
276 276
277 if (!reason.empty()) 277 if (!reason.empty())
278 policy.set_reason(reason); 278 policy.set_reason(reason);
279 client_->SetPolicy(policy); 279 client_->SetPolicy(policy);
280 } 280 }
281 281
282 } // namespace chromeos 282 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/tools/convert_dict/hunspell_reader.cc ('k') | chromeos/system/name_value_pairs_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698