OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #if !defined(__has_feature) || !__has_feature(objc_arc) | 5 #if !defined(__has_feature) || !__has_feature(objc_arc) |
6 #error "This file requires ARC support." | 6 #error "This file requires ARC support." |
7 #endif | 7 #endif |
8 | 8 |
9 #import "remoting/client/ios/bridge/client_proxy.h" | 9 #import "remoting/client/ios/bridge/client_proxy.h" |
10 | 10 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 const std::string& pairingId, | 191 const std::string& pairingId, |
192 const std::string& pairingSecret) { | 192 const std::string& pairingSecret) { |
193 NSString* hostNameAsNSString = base::SysUTF8ToNSString(hostName); | 193 NSString* hostNameAsNSString = base::SysUTF8ToNSString(hostName); |
194 | 194 |
195 // Check if credentials are currently stored, and if so, delete them. | 195 // Check if credentials are currently stored, and if so, delete them. |
196 HostPreferences* existingHost = | 196 HostPreferences* existingHost = |
197 [HostPreferences hostForId:hostNameAsNSString]; | 197 [HostPreferences hostForId:hostNameAsNSString]; |
198 if (existingHost != nil) { | 198 if (existingHost != nil) { |
199 existingHost.pairId = @""; | 199 existingHost.pairId = @""; |
200 existingHost.pairSecret = @""; | 200 existingHost.pairSecret = @""; |
201 [existingHost saveToSSOKeychain]; | 201 [existingHost saveToKeychain]; |
202 } | 202 } |
203 | 203 |
204 clientProxy_->CommitPairingCredentials(hostName, pairingId, pairingSecret); | 204 clientProxy_->CommitPairingCredentials(hostName, pairingId, pairingSecret); |
205 | 205 |
206 // Fetch new credentials from keychain. | 206 // Fetch new credentials from keychain. |
207 HostPreferences* host = [HostPreferences hostForId:hostNameAsNSString]; | 207 HostPreferences* host = [HostPreferences hostForId:hostNameAsNSString]; |
208 | 208 |
209 ASSERT_TRUE(host != nil); | 209 ASSERT_TRUE(host != nil); |
210 ASSERT_TRUE([base::SysUTF8ToNSString(hostName) | 210 ASSERT_TRUE([base::SysUTF8ToNSString(hostName) |
211 isEqualToString:host.hostId]); | 211 isEqualToString:host.hostId]); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 ASSERT_EQ(kCursorHotSpotX, delegateTester_.hotspot.x()); | 362 ASSERT_EQ(kCursorHotSpotX, delegateTester_.hotspot.x()); |
363 ASSERT_EQ(kCursorHotSpotY, delegateTester_.hotspot.y()); | 363 ASSERT_EQ(kCursorHotSpotY, delegateTester_.hotspot.y()); |
364 ASSERT_TRUE(delegateTester_.data != NULL); | 364 ASSERT_TRUE(delegateTester_.data != NULL); |
365 for (int i = 0; i < kCursorDataLength / 4; i++) { | 365 for (int i = 0; i < kCursorDataLength / 4; i++) { |
366 ASSERT_TRUE(memcmp(&delegateTester_.data[i * 4], &kCursorDataPattern, 4) == | 366 ASSERT_TRUE(memcmp(&delegateTester_.data[i * 4], &kCursorDataPattern, 4) == |
367 0); | 367 0); |
368 } | 368 } |
369 } | 369 } |
370 | 370 |
371 } // namespace remoting | 371 } // namespace remoting |
OLD | NEW |