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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « chrome/test/chromedriver/window_commands.cc ('k') | chromeos/dbus/shill_client_helper.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 "chromeos/dbus/fake_shill_service_client.h" 5 #include "chromeos/dbus/fake_shill_service_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // from Shill. Properties that start with "Provider" need to have that 413 // from Shill. Properties that start with "Provider" need to have that
414 // stripped off, other properties are nested in the "Provider" dictionary 414 // stripped off, other properties are nested in the "Provider" dictionary
415 // as-is. 415 // as-is.
416 std::string key = property; 416 std::string key = property;
417 if (base::StartsWith(property, "Provider.", case_sensitive)) 417 if (base::StartsWith(property, "Provider.", case_sensitive))
418 key = property.substr(strlen("Provider.")); 418 key = property.substr(strlen("Provider."));
419 base::DictionaryValue* provider = new base::DictionaryValue; 419 base::DictionaryValue* provider = new base::DictionaryValue;
420 provider->SetWithoutPathExpansion(key, value.DeepCopy()); 420 provider->SetWithoutPathExpansion(key, value.DeepCopy());
421 new_properties.SetWithoutPathExpansion(shill::kProviderProperty, provider); 421 new_properties.SetWithoutPathExpansion(shill::kProviderProperty, provider);
422 changed_property = shill::kProviderProperty; 422 changed_property = shill::kProviderProperty;
423 } else if (value.GetType() == base::Value::TYPE_DICTIONARY) { 423 } else if (value.GetType() == base::Value::Type::DICTIONARY) {
424 const base::DictionaryValue* new_dict = NULL; 424 const base::DictionaryValue* new_dict = NULL;
425 value.GetAsDictionary(&new_dict); 425 value.GetAsDictionary(&new_dict);
426 CHECK(new_dict); 426 CHECK(new_dict);
427 std::unique_ptr<base::Value> cur_value; 427 std::unique_ptr<base::Value> cur_value;
428 base::DictionaryValue* cur_dict; 428 base::DictionaryValue* cur_dict;
429 if (dict->RemoveWithoutPathExpansion(property, &cur_value) && 429 if (dict->RemoveWithoutPathExpansion(property, &cur_value) &&
430 cur_value->GetAsDictionary(&cur_dict)) { 430 cur_value->GetAsDictionary(&cur_dict)) {
431 cur_dict->Clear(); 431 cur_dict->Clear();
432 cur_dict->MergeDictionary(new_dict); 432 cur_dict->MergeDictionary(new_dict);
433 new_properties.SetWithoutPathExpansion(property, cur_value.release()); 433 new_properties.SetWithoutPathExpansion(property, cur_value.release());
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 base::StringValue(shill::kErrorBadPassphrase))); 626 base::StringValue(shill::kErrorBadPassphrase)));
627 } else { 627 } else {
628 // Set Online. 628 // Set Online.
629 VLOG(1) << "Setting state to Online " << service_path; 629 VLOG(1) << "Setting state to Online " << service_path;
630 SetServiceProperty(service_path, shill::kStateProperty, 630 SetServiceProperty(service_path, shill::kStateProperty,
631 base::StringValue(shill::kStateOnline)); 631 base::StringValue(shill::kStateOnline));
632 } 632 }
633 } 633 }
634 634
635 } // namespace chromeos 635 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/window_commands.cc ('k') | chromeos/dbus/shill_client_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698