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

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_provider.cc

Issue 23712002: Cleanup network type matching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit test in Debug. Created 7 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/settings/device_settings_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.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/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" 23 #include "chrome/browser/policy/cloud/cloud_policy_constants.h"
24 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 24 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
25 #include "chrome/browser/ui/options/options_util.h" 25 #include "chrome/browser/ui/options/options_util.h"
26 #include "chrome/installer/util/google_update_settings.h" 26 #include "chrome/installer/util/google_update_settings.h"
27 #include "chromeos/chromeos_switches.h" 27 #include "chromeos/chromeos_switches.h"
28 #include "chromeos/network/device_state.h" 28 #include "chromeos/network/device_state.h"
29 #include "chromeos/network/network_device_handler.h" 29 #include "chromeos/network/network_device_handler.h"
30 #include "chromeos/network/network_event_log.h" 30 #include "chromeos/network/network_event_log.h"
31 #include "chromeos/network/network_handler.h" 31 #include "chromeos/network/network_handler.h"
32 #include "chromeos/network/network_state_handler.h" 32 #include "chromeos/network/network_state_handler.h"
33 #include "chromeos/network/shill_property_util.h"
33 #include "third_party/cros_system_api/dbus/service_constants.h" 34 #include "third_party/cros_system_api/dbus/service_constants.h"
34 35
35 using google::protobuf::RepeatedField; 36 using google::protobuf::RepeatedField;
36 using google::protobuf::RepeatedPtrField; 37 using google::protobuf::RepeatedPtrField;
37 38
38 namespace em = enterprise_management; 39 namespace em = enterprise_management;
39 40
40 namespace chromeos { 41 namespace chromeos {
41 42
42 namespace { 43 namespace {
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 VLOG(1) << "Metrics policy is being set to : " << new_value 819 VLOG(1) << "Metrics policy is being set to : " << new_value
819 << "(use file : " << use_file << ")"; 820 << "(use file : " << use_file << ")";
820 // TODO(pastarmovj): Remove this once we don't need to regenerate the 821 // TODO(pastarmovj): Remove this once we don't need to regenerate the
821 // consent file for the GUID anymore. 822 // consent file for the GUID anymore.
822 OptionsUtil::ResolveMetricsReportingEnabled(new_value); 823 OptionsUtil::ResolveMetricsReportingEnabled(new_value);
823 } 824 }
824 825
825 void DeviceSettingsProvider::ApplyRoamingSetting(bool new_value) { 826 void DeviceSettingsProvider::ApplyRoamingSetting(bool new_value) {
826 // TODO(armansito): Look up the device by explicitly using the device path. 827 // TODO(armansito): Look up the device by explicitly using the device path.
827 const DeviceState* cellular = 828 const DeviceState* cellular =
828 NetworkHandler::Get()->network_state_handler()-> 829 NetworkHandler::Get()->network_state_handler()->GetDeviceStateByType(
829 GetDeviceStateByType(flimflam::kTypeCellular); 830 NetworkTypePattern::Cellular());
830 if (!cellular) { 831 if (!cellular) {
831 NET_LOG_DEBUG("No cellular device is available", 832 NET_LOG_DEBUG("No cellular device is available",
832 "Roaming is only supported by cellular devices."); 833 "Roaming is only supported by cellular devices.");
833 return; 834 return;
834 } 835 }
835 bool current_value; 836 bool current_value;
836 if (!cellular->properties().GetBooleanWithoutPathExpansion( 837 if (!cellular->properties().GetBooleanWithoutPathExpansion(
837 flimflam::kCellularAllowRoamingProperty, &current_value)) { 838 flimflam::kCellularAllowRoamingProperty, &current_value)) {
838 NET_LOG_ERROR("Could not get \"allow roaming\" property from cellular " 839 NET_LOG_ERROR("Could not get \"allow roaming\" property from cellular "
839 "device.", cellular->path()); 840 "device.", cellular->path());
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 void DeviceSettingsProvider::AttemptMigration() { 1014 void DeviceSettingsProvider::AttemptMigration() {
1014 if (device_settings_service_->HasPrivateOwnerKey()) { 1015 if (device_settings_service_->HasPrivateOwnerKey()) {
1015 PrefValueMap::const_iterator i; 1016 PrefValueMap::const_iterator i;
1016 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) 1017 for (i = migration_values_.begin(); i != migration_values_.end(); ++i)
1017 DoSet(i->first, *i->second); 1018 DoSet(i->first, *i->second);
1018 migration_values_.Clear(); 1019 migration_values_.Clear();
1019 } 1020 }
1020 } 1021 }
1021 1022
1022 } // namespace chromeos 1023 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/prerender_condition_network.cc ('k') | chrome/browser/chromeos/status/network_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698