| 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/identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/identity_api.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 StartSigninFlow(); | 122 StartSigninFlow(); |
| 123 } else { | 123 } else { |
| 124 StartMintTokenFlow(IdentityMintRequestQueue::MINT_TYPE_NONINTERACTIVE); | 124 StartMintTokenFlow(IdentityMintRequestQueue::MINT_TYPE_NONINTERACTIVE); |
| 125 } | 125 } |
| 126 | 126 |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 | 129 |
| 130 void IdentityGetAuthTokenFunction::CompleteFunctionWithResult( | 130 void IdentityGetAuthTokenFunction::CompleteFunctionWithResult( |
| 131 const std::string& access_token) { | 131 const std::string& access_token) { |
| 132 SetResult(Value::CreateStringValue(access_token)); | 132 SetResult(new base::StringValue(access_token)); |
| 133 SendResponse(true); | 133 SendResponse(true); |
| 134 Release(); // Balanced in RunImpl. | 134 Release(); // Balanced in RunImpl. |
| 135 } | 135 } |
| 136 | 136 |
| 137 void IdentityGetAuthTokenFunction::CompleteFunctionWithError( | 137 void IdentityGetAuthTokenFunction::CompleteFunctionWithError( |
| 138 const std::string& error) { | 138 const std::string& error) { |
| 139 error_ = error; | 139 error_ = error; |
| 140 SendResponse(false); | 140 SendResponse(false); |
| 141 Release(); // Balanced in RunImpl. | 141 Release(); // Balanced in RunImpl. |
| 142 } | 142 } |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 error_ = identity_constants::kInvalidRedirect; | 592 error_ = identity_constants::kInvalidRedirect; |
| 593 break; | 593 break; |
| 594 } | 594 } |
| 595 SendResponse(false); | 595 SendResponse(false); |
| 596 Release(); // Balanced in RunImpl. | 596 Release(); // Balanced in RunImpl. |
| 597 } | 597 } |
| 598 | 598 |
| 599 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( | 599 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( |
| 600 const GURL& redirect_url) { | 600 const GURL& redirect_url) { |
| 601 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { | 601 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { |
| 602 SetResult(Value::CreateStringValue(redirect_url.spec())); | 602 SetResult(new base::StringValue(redirect_url.spec())); |
| 603 SendResponse(true); | 603 SendResponse(true); |
| 604 Release(); // Balanced in RunImpl. | 604 Release(); // Balanced in RunImpl. |
| 605 } | 605 } |
| 606 } | 606 } |
| 607 | 607 |
| 608 IdentityTokenCacheValue::IdentityTokenCacheValue() | 608 IdentityTokenCacheValue::IdentityTokenCacheValue() |
| 609 : status_(CACHE_STATUS_NOTFOUND) { | 609 : status_(CACHE_STATUS_NOTFOUND) { |
| 610 } | 610 } |
| 611 | 611 |
| 612 IdentityTokenCacheValue::IdentityTokenCacheValue( | 612 IdentityTokenCacheValue::IdentityTokenCacheValue( |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 const IdentityAPI::TokenCacheKey& rhs) const { | 769 const IdentityAPI::TokenCacheKey& rhs) const { |
| 770 if (extension_id < rhs.extension_id) | 770 if (extension_id < rhs.extension_id) |
| 771 return true; | 771 return true; |
| 772 else if (rhs.extension_id < extension_id) | 772 else if (rhs.extension_id < extension_id) |
| 773 return false; | 773 return false; |
| 774 | 774 |
| 775 return scopes < rhs.scopes; | 775 return scopes < rhs.scopes; |
| 776 } | 776 } |
| 777 | 777 |
| 778 } // namespace extensions | 778 } // namespace extensions |
| OLD | NEW |