| OLD | NEW |
| 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/extensions/api/identity/experimental_identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/experimental_identity_api.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 StartSigninFlow(); | 95 StartSigninFlow(); |
| 96 } else { | 96 } else { |
| 97 StartMintTokenFlow(IdentityMintRequestQueue::MINT_TYPE_NONINTERACTIVE); | 97 StartMintTokenFlow(IdentityMintRequestQueue::MINT_TYPE_NONINTERACTIVE); |
| 98 } | 98 } |
| 99 | 99 |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ExperimentalIdentityGetAuthTokenFunction::CompleteFunctionWithResult( | 103 void ExperimentalIdentityGetAuthTokenFunction::CompleteFunctionWithResult( |
| 104 const std::string& access_token) { | 104 const std::string& access_token) { |
| 105 SetResult(Value::CreateStringValue(access_token)); | 105 SetResult(new base::StringValue(access_token)); |
| 106 SendResponse(true); | 106 SendResponse(true); |
| 107 Release(); // Balanced in RunImpl. | 107 Release(); // Balanced in RunImpl. |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ExperimentalIdentityGetAuthTokenFunction::CompleteFunctionWithError( | 110 void ExperimentalIdentityGetAuthTokenFunction::CompleteFunctionWithError( |
| 111 const std::string& error) { | 111 const std::string& error) { |
| 112 error_ = error; | 112 error_ = error; |
| 113 SendResponse(false); | 113 SendResponse(false); |
| 114 Release(); // Balanced in RunImpl. | 114 Release(); // Balanced in RunImpl. |
| 115 } | 115 } |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 error_ = identity_constants::kInvalidRedirect; | 378 error_ = identity_constants::kInvalidRedirect; |
| 379 break; | 379 break; |
| 380 } | 380 } |
| 381 SendResponse(false); | 381 SendResponse(false); |
| 382 Release(); // Balanced in RunImpl. | 382 Release(); // Balanced in RunImpl. |
| 383 } | 383 } |
| 384 | 384 |
| 385 void ExperimentalIdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( | 385 void ExperimentalIdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( |
| 386 const GURL& redirect_url) { | 386 const GURL& redirect_url) { |
| 387 if (IsFinalRedirectURL(redirect_url)) { | 387 if (IsFinalRedirectURL(redirect_url)) { |
| 388 SetResult(Value::CreateStringValue(redirect_url.spec())); | 388 SetResult(new base::StringValue(redirect_url.spec())); |
| 389 SendResponse(true); | 389 SendResponse(true); |
| 390 Release(); // Balanced in RunImpl. | 390 Release(); // Balanced in RunImpl. |
| 391 } | 391 } |
| 392 } | 392 } |
| 393 | 393 |
| 394 void ExperimentalIdentityLaunchWebAuthFlowFunction:: | 394 void ExperimentalIdentityLaunchWebAuthFlowFunction:: |
| 395 InitFinalRedirectURLPrefixesForTest(const std::string& extension_id) { | 395 InitFinalRedirectURLPrefixesForTest(const std::string& extension_id) { |
| 396 final_prefixes_.clear(); | 396 final_prefixes_.clear(); |
| 397 InitFinalRedirectURLPrefixes(extension_id); | 397 InitFinalRedirectURLPrefixes(extension_id); |
| 398 } | 398 } |
| 399 | 399 |
| 400 } // namespace extensions | 400 } // namespace extensions |
| OLD | NEW |