summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/cros/network_library.cc
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 02:22:19 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-15 02:22:19 +0000
commitc8c3f37f7dc08aee5f9199aa00a3c36c5403d9c5 (patch)
treefe62f0694817ca5ecca557b667220039e5fc5101 /chrome/browser/chromeos/cros/network_library.cc
parent953067b9f13194d1ac77fc8652cbf1b1066f765b (diff)
downloadchromium_src-c8c3f37f7dc08aee5f9199aa00a3c36c5403d9c5.zip
chromium_src-c8c3f37f7dc08aee5f9199aa00a3c36c5403d9c5.tar.gz
chromium_src-c8c3f37f7dc08aee5f9199aa00a3c36c5403d9c5.tar.bz2
Revert 167808 - Get rid of use of CreateStringValue in chromeos/ directory.
Reverting because the patch makes clang build failing: > chrome/browser/chromeos/cros/network_library.cc:380:26:error: C++98 requires an > accessible copy constructor for class 'base::StringValue' when binding a > reference to a temporary; was private [-Werror,-Wbind-to-temporary-copy] > SetValueProperty(prop, base::StringValue(str)); etc. BUG=160586 Review URL: https://chromiumcodereview.appspot.com/11363203 TBR=estade@chromium.org Review URL: https://codereview.chromium.org/11369258 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/cros/network_library.cc')
-rw-r--r--chrome/browser/chromeos/cros/network_library.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc
index f2f4a8c..8600d88 100644
--- a/chrome/browser/chromeos/cros/network_library.cc
+++ b/chrome/browser/chromeos/cros/network_library.cc
@@ -359,11 +359,12 @@ bool Network::RequiresUserProfile() const {
void Network::CopyCredentialsFromRemembered(Network* remembered) {
}
-void Network::SetValueProperty(const char* prop, const base::Value& value) {
+void Network::SetValueProperty(const char* prop, Value* value) {
DCHECK(prop);
+ DCHECK(value);
if (!EnsureCrosLoaded())
return;
- CrosSetNetworkServiceProperty(service_path_, prop, value);
+ CrosSetNetworkServiceProperty(service_path_, prop, *value);
}
void Network::ClearProperty(const char* prop) {
@@ -377,7 +378,8 @@ void Network::SetStringProperty(
const char* prop, const std::string& str, std::string* dest) {
if (dest)
*dest = str;
- SetValueProperty(prop, base::StringValue(str));
+ scoped_ptr<Value> value(Value::CreateStringValue(str));
+ SetValueProperty(prop, value.get());
}
void Network::SetOrClearStringProperty(const char* prop,
@@ -395,13 +397,15 @@ void Network::SetOrClearStringProperty(const char* prop,
void Network::SetBooleanProperty(const char* prop, bool b, bool* dest) {
if (dest)
*dest = b;
- SetValueProperty(prop, base::FundamentalValue(b));
+ scoped_ptr<Value> value(Value::CreateBooleanValue(b));
+ SetValueProperty(prop, value.get());
}
void Network::SetIntegerProperty(const char* prop, int i, int* dest) {
if (dest)
*dest = i;
- SetValueProperty(prop, base::FundamentalValue(i));
+ scoped_ptr<Value> value(Value::CreateIntegerValue(i));
+ SetValueProperty(prop, value.get());
}
void Network::SetPreferred(bool preferred) {
@@ -880,7 +884,7 @@ void CellularNetwork::SetApn(const CellularApn& apn) {
value.SetString(flimflam::kApnNetworkIdProperty, apn.network_id);
value.SetString(flimflam::kApnUsernameProperty, apn.username);
value.SetString(flimflam::kApnPasswordProperty, apn.password);
- SetValueProperty(flimflam::kCellularApnProperty, value);
+ SetValueProperty(flimflam::kCellularApnProperty, &value);
} else {
ClearProperty(flimflam::kCellularApnProperty);
}