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

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

Issue 1029563002: Fix the fake portaled WiFi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the path constant. Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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_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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 "", /* empty GUID */ 714 "", /* empty GUID */
715 "wifi3" /* name */, 715 "wifi3" /* name */,
716 shill::kTypeWifi, 716 shill::kTypeWifi,
717 shill::kStateIdle, 717 shill::kStateIdle,
718 add_to_visible); 718 add_to_visible);
719 services->SetServiceProperty( 719 services->SetServiceProperty(
720 kWifi3Path, shill::kSignalStrengthProperty, base::FundamentalValue(40)); 720 kWifi3Path, shill::kSignalStrengthProperty, base::FundamentalValue(40));
721 721
722 if (portaled) { 722 if (portaled) {
723 const std::string kPortaledWifiPath = "/service/portaled_wifi"; 723 const std::string kPortaledWifiPath = "/service/portaled_wifi";
724 services->AddService(kPortaledWifiPath, 724 services->AddService(kPortaledWifiPath, "portaled_wifi_guid",
725 "portaled_wifi_guid", 725 "Portaled Wifi" /* name */, shill::kTypeWifi,
726 "Portaled Wifi" /* name */, 726 shill::kStateIdle, add_to_visible);
727 shill::kTypeWifi,
728 shill::kStatePortal,
729 add_to_visible);
730 services->SetServiceProperty(kPortaledWifiPath, 727 services->SetServiceProperty(kPortaledWifiPath,
731 shill::kSecurityClassProperty, 728 shill::kSecurityClassProperty,
732 base::StringValue(shill::kSecurityNone)); 729 base::StringValue(shill::kSecurityNone));
733 services->SetConnectBehavior(kPortaledWifiPath, 730 services->SetConnectBehavior(
734 base::Bind(&UpdatePortaledWifiState, 731 kPortaledWifiPath,
735 "portaled_wifi")); 732 base::Bind(&UpdatePortaledWifiState, kPortaledWifiPath));
736 services->SetServiceProperty(kPortaledWifiPath, 733 services->SetServiceProperty(kPortaledWifiPath,
737 shill::kConnectableProperty, 734 shill::kConnectableProperty,
738 base::FundamentalValue(true)); 735 base::FundamentalValue(true));
739 profiles->AddService(shared_profile, kPortaledWifiPath); 736 profiles->AddService(shared_profile, kPortaledWifiPath);
740 } 737 }
741 } 738 }
742 739
743 // Wimax 740 // Wimax
744 const std::string kWimaxPath = "/service/wimax1"; 741 const std::string kWimaxPath = "/service/wimax1";
745 state = GetInitialStateForType(shill::kTypeWimax, &enabled); 742 state = GetInitialStateForType(shill::kTypeWimax, &enabled);
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 *enabled = true; 1158 *enabled = true;
1162 if ((state == shill::kStatePortal && type != shill::kTypeWifi) || 1159 if ((state == shill::kStatePortal && type != shill::kTypeWifi) ||
1163 (state == kNetworkActivated && type != shill::kTypeCellular)) { 1160 (state == kNetworkActivated && type != shill::kTypeCellular)) {
1164 LOG(WARNING) << "Invalid state: " << state << " for " << type; 1161 LOG(WARNING) << "Invalid state: " << state << " for " << type;
1165 return shill::kStateIdle; 1162 return shill::kStateIdle;
1166 } 1163 }
1167 return state; 1164 return state;
1168 } 1165 }
1169 1166
1170 } // namespace chromeos 1167 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698