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

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

Issue 700383008: Use setProperties for Cellular APN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430113_internet_options_2
Patch Set: Feedback Created 5 years, 11 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
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_manager_client.h" 5 #include "chromeos/dbus/fake_shill_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 shill::kSupportedCarriersProperty, 752 shill::kSupportedCarriersProperty,
753 carrier_list); 753 carrier_list);
754 754
755 services->AddService(kCellularServicePath, 755 services->AddService(kCellularServicePath,
756 "cellular1_guid", 756 "cellular1_guid",
757 "cellular1" /* name */, 757 "cellular1" /* name */,
758 shill::kTypeCellular, 758 shill::kTypeCellular,
759 state, 759 state,
760 add_to_visible); 760 add_to_visible);
761 base::StringValue technology_value(shill::kNetworkTechnologyGsm); 761 base::StringValue technology_value(shill::kNetworkTechnologyGsm);
762 devices->SetDeviceProperty("/device/cellular1",
763 shill::kTechnologyFamilyProperty,
764 technology_value);
762 services->SetServiceProperty(kCellularServicePath, 765 services->SetServiceProperty(kCellularServicePath,
763 shill::kNetworkTechnologyProperty, 766 shill::kNetworkTechnologyProperty,
764 technology_value); 767 technology_value);
765 768
766 if (activated) { 769 if (activated) {
767 services->SetServiceProperty( 770 services->SetServiceProperty(
768 kCellularServicePath, 771 kCellularServicePath,
769 shill::kActivationStateProperty, 772 shill::kActivationStateProperty,
770 base::StringValue(shill::kActivationStateActivated)); 773 base::StringValue(shill::kActivationStateActivated));
771 services->SetServiceProperty(kCellularServicePath, 774 services->SetServiceProperty(kCellularServicePath,
772 shill::kConnectableProperty, 775 shill::kConnectableProperty,
773 base::FundamentalValue(true)); 776 base::FundamentalValue(true));
774 } else { 777 } else {
775 services->SetServiceProperty( 778 services->SetServiceProperty(
776 kCellularServicePath, 779 kCellularServicePath,
777 shill::kActivationStateProperty, 780 shill::kActivationStateProperty,
778 base::StringValue(shill::kActivationStateNotActivated)); 781 base::StringValue(shill::kActivationStateNotActivated));
779 } 782 }
780 783
781 services->SetServiceProperty(kCellularServicePath, 784 services->SetServiceProperty(kCellularServicePath,
782 shill::kRoamingStateProperty, 785 shill::kRoamingStateProperty,
783 base::StringValue(shill::kRoamingStateHome)); 786 base::StringValue(shill::kRoamingStateHome));
787 profiles->AddService(shared_profile, kCellularServicePath);
784 } 788 }
785 789
786 // VPN 790 // VPN
787 state = GetInitialStateForType(shill::kTypeVPN, &enabled); 791 state = GetInitialStateForType(shill::kTypeVPN, &enabled);
788 if (state != kTechnologyUnavailable) { 792 if (state != kTechnologyUnavailable) {
789 // Set the "Provider" dictionary properties. Note: when setting these in 793 // Set the "Provider" dictionary properties. Note: when setting these in
790 // Shill, "Provider.Type", etc keys are used, but when reading the values 794 // Shill, "Provider.Type", etc keys are used, but when reading the values
791 // "Provider" . "Type", etc keys are used. Here we are setting the values 795 // "Provider" . "Type", etc keys are used. Here we are setting the values
792 // that will be read (by the UI, tests, etc). 796 // that will be read (by the UI, tests, etc).
793 base::DictionaryValue provider_properties_openvpn; 797 base::DictionaryValue provider_properties_openvpn;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 *enabled = true; 1105 *enabled = true;
1102 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || 1106 if ((state == shill::kStatePortal && type != shill::kTypeWifi) ||
1103 (state == kNetworkActivated && type != shill::kTypeCellular)) { 1107 (state == kNetworkActivated && type != shill::kTypeCellular)) {
1104 LOG(WARNING) << "Invalid state: " << state << " for " << type; 1108 LOG(WARNING) << "Invalid state: " << state << " for " << type;
1105 return shill::kStateIdle; 1109 return shill::kStateIdle;
1106 } 1110 }
1107 return state; 1111 return state;
1108 } 1112 }
1109 1113
1110 } // namespace chromeos 1114 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698