Chromium Code Reviews| 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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 936 break; | 936 break; |
| 937 case WebAuthFlow::LOAD_FAILED: | 937 case WebAuthFlow::LOAD_FAILED: |
| 938 error_ = identity_constants::kPageLoadFailure; | 938 error_ = identity_constants::kPageLoadFailure; |
| 939 break; | 939 break; |
| 940 default: | 940 default: |
| 941 NOTREACHED() << "Unexpected error from web auth flow: " << failure; | 941 NOTREACHED() << "Unexpected error from web auth flow: " << failure; |
| 942 error_ = identity_constants::kInvalidRedirect; | 942 error_ = identity_constants::kInvalidRedirect; |
| 943 break; | 943 break; |
| 944 } | 944 } |
| 945 SendResponse(false); | 945 SendResponse(false); |
| 946 Release(); // Balanced in RunAsync. | 946 Release(); // Balanced in RunAsync. |
|
Michael Courage
2015/01/08 22:45:27
Would we not also want to detach here as well?
| |
| 947 } | 947 } |
| 948 | 948 |
| 949 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( | 949 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( |
| 950 const GURL& redirect_url) { | 950 const GURL& redirect_url) { |
| 951 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { | 951 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { |
| 952 SetResult(new base::StringValue(redirect_url.spec())); | 952 SetResult(new base::StringValue(redirect_url.spec())); |
| 953 SendResponse(true); | 953 SendResponse(true); |
| 954 if (auth_flow_) | |
| 955 auth_flow_.release()->DetachDelegateAndDelete(); | |
| 954 Release(); // Balanced in RunAsync. | 956 Release(); // Balanced in RunAsync. |
| 955 } | 957 } |
| 956 } | 958 } |
| 957 | 959 |
| 958 } // namespace extensions | 960 } // namespace extensions |
| OLD | NEW |