| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/sync/test/integration/wifi_credentials_helper.h" | 5 #include "chrome/browser/sync/test/integration/wifi_credentials_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 10 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 scoped_ptr<WifiCredential> MakeWifiCredential(const std::string& ssid, | 131 scoped_ptr<WifiCredential> MakeWifiCredential(const std::string& ssid, |
| 132 WifiSecurityClass security_class, | 132 WifiSecurityClass security_class, |
| 133 const std::string& passphrase) { | 133 const std::string& passphrase) { |
| 134 return WifiCredential::Create(WifiCredential::MakeSsidBytesForTest(ssid), | 134 return WifiCredential::Create(WifiCredential::MakeSsidBytesForTest(ssid), |
| 135 security_class, | 135 security_class, |
| 136 passphrase); | 136 passphrase); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void AddWifiCredential(int profile_index, | 139 void AddWifiCredential(int profile_index, |
| 140 const std::string& sync_id, | |
| 141 const WifiCredential& credential) { | 140 const WifiCredential& credential) { |
| 142 AddWifiCredentialToProfile(test()->GetProfile(profile_index), credential); | 141 AddWifiCredentialToProfile(test()->GetProfile(profile_index), credential); |
| 143 if (test()->use_verifier()) | 142 if (test()->use_verifier()) |
| 144 AddWifiCredentialToProfile(test()->verifier(), credential); | 143 AddWifiCredentialToProfile(test()->verifier(), credential); |
| 145 | 144 |
| 146 // TODO(quiche): Remove this, once we have plumbing to route | 145 // TODO(quiche): Remove this, once we have plumbing to route |
| 147 // NetworkConfigurationObserver events to | 146 // NetworkConfigurationObserver events to |
| 148 // WifiCredentialSyncableService instances. | 147 // WifiCredentialSyncableService instances. |
| 149 GetServiceForProfile(profile_index) | 148 GetServiceForProfile(profile_index)->AddToSyncedNetworks(credential); |
| 150 ->AddToSyncedNetworks(sync_id, credential); | |
| 151 } | 149 } |
| 152 | 150 |
| 153 WifiCredentialSet GetWifiCredentialsForProfile(const Profile* profile) { | 151 WifiCredentialSet GetWifiCredentialsForProfile(const Profile* profile) { |
| 154 #if defined(OS_CHROMEOS) | 152 #if defined(OS_CHROMEOS) |
| 155 return wifi_credentials_helper::chromeos:: | 153 return wifi_credentials_helper::chromeos:: |
| 156 GetWifiCredentialsForProfileChromeOs(profile); | 154 GetWifiCredentialsForProfileChromeOs(profile); |
| 157 #else | 155 #else |
| 158 NOTREACHED(); | 156 NOTREACHED(); |
| 159 return WifiCredential::MakeSet(); | 157 return WifiCredential::MakeSet(); |
| 160 #endif | 158 #endif |
| 161 } | 159 } |
| 162 | 160 |
| 163 } // namespace wifi_credentials_helper | 161 } // namespace wifi_credentials_helper |
| OLD | NEW |