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

Side by Side Diff: extensions/common/feature_switch.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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | google_apis/gaia/oauth2_mint_token_flow.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "extensions/common/feature_switch.h" 5 #include "extensions/common/feature_switch.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 default_value_ = default_value == DEFAULT_ENABLED; 103 default_value_ = default_value == DEFAULT_ENABLED;
104 override_value_ = OVERRIDE_NONE; 104 override_value_ = OVERRIDE_NONE;
105 } 105 }
106 106
107 bool FeatureSwitch::IsEnabled() const { 107 bool FeatureSwitch::IsEnabled() const {
108 if (override_value_ != OVERRIDE_NONE) 108 if (override_value_ != OVERRIDE_NONE)
109 return override_value_ == OVERRIDE_ENABLED; 109 return override_value_ == OVERRIDE_ENABLED;
110 110
111 std::string temp = command_line_->GetSwitchValueASCII(switch_name_); 111 std::string temp = command_line_->GetSwitchValueASCII(switch_name_);
112 std::string switch_value; 112 std::string switch_value;
113 TrimWhitespaceASCII(temp, TRIM_ALL, &switch_value); 113 base::TrimWhitespaceASCII(temp, base::TRIM_ALL, &switch_value);
114 114
115 if (switch_value == "1") 115 if (switch_value == "1")
116 return true; 116 return true;
117 117
118 if (switch_value == "0") 118 if (switch_value == "0")
119 return false; 119 return false;
120 120
121 if (!default_value_ && command_line_->HasSwitch(GetLegacyEnableFlag())) 121 if (!default_value_ && command_line_->HasSwitch(GetLegacyEnableFlag()))
122 return true; 122 return true;
123 123
(...skipping 13 matching lines...) Expand all
137 137
138 void FeatureSwitch::SetOverrideValue(OverrideValue override_value) { 138 void FeatureSwitch::SetOverrideValue(OverrideValue override_value) {
139 override_value_ = override_value; 139 override_value_ = override_value;
140 } 140 }
141 141
142 FeatureSwitch::OverrideValue FeatureSwitch::GetOverrideValue() const { 142 FeatureSwitch::OverrideValue FeatureSwitch::GetOverrideValue() const {
143 return override_value_; 143 return override_value_;
144 } 144 }
145 145
146 } // namespace extensions 146 } // namespace extensions
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | google_apis/gaia/oauth2_mint_token_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698