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

Unified Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 11363203: Get rid of use of CreateStringValue in chromeos/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/cros/network_library.cc
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc
index ba81959f9ca67c62995c2401e8004f193d89b7ea..4b71e3070633329d9d901210b2fa72072fbd98b8 100644
--- a/chrome/browser/chromeos/cros/network_library.cc
+++ b/chrome/browser/chromeos/cros/network_library.cc
@@ -360,12 +360,11 @@ bool Network::RequiresUserProfile() const {
void Network::CopyCredentialsFromRemembered(Network* remembered) {
}
-void Network::SetValueProperty(const char* prop, Value* value) {
+void Network::SetValueProperty(const char* prop, const base::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) {
@@ -379,8 +378,7 @@ void Network::SetStringProperty(
const char* prop, const std::string& str, std::string* dest) {
if (dest)
*dest = str;
- scoped_ptr<Value> value(Value::CreateStringValue(str));
- SetValueProperty(prop, value.get());
+ SetValueProperty(prop, base::StringValue(str));
}
void Network::SetOrClearStringProperty(const char* prop,
@@ -398,15 +396,13 @@ void Network::SetOrClearStringProperty(const char* prop,
void Network::SetBooleanProperty(const char* prop, bool b, bool* dest) {
if (dest)
*dest = b;
- scoped_ptr<Value> value(Value::CreateBooleanValue(b));
- SetValueProperty(prop, value.get());
+ SetValueProperty(prop, base::FundamentalValue(b));
}
void Network::SetIntegerProperty(const char* prop, int i, int* dest) {
if (dest)
*dest = i;
- scoped_ptr<Value> value(Value::CreateIntegerValue(i));
- SetValueProperty(prop, value.get());
+ SetValueProperty(prop, base::FundamentalValue(i));
}
void Network::SetPreferred(bool preferred) {
@@ -874,7 +870,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);
}

Powered by Google App Engine
This is Rietveld 408576698