| 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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 return RespondNow(Error(identity_constants::kOffTheRecord)); | 845 return RespondNow(Error(identity_constants::kOffTheRecord)); |
| 846 } | 846 } |
| 847 | 847 |
| 848 AccountTrackerService::AccountInfo account = | 848 AccountTrackerService::AccountInfo account = |
| 849 AccountTrackerServiceFactory::GetForProfile(GetProfile()) | 849 AccountTrackerServiceFactory::GetForProfile(GetProfile()) |
| 850 ->GetAccountInfo(GetPrimaryAccountId(GetProfile())); | 850 ->GetAccountInfo(GetPrimaryAccountId(GetProfile())); |
| 851 api::identity::ProfileUserInfo profile_user_info; | 851 api::identity::ProfileUserInfo profile_user_info; |
| 852 if (extension()->permissions_data()->HasAPIPermission( | 852 if (extension()->permissions_data()->HasAPIPermission( |
| 853 APIPermission::kIdentityEmail)) { | 853 APIPermission::kIdentityEmail)) { |
| 854 profile_user_info.email = account.email; | 854 profile_user_info.email = account.email; |
| 855 profile_user_info.id = account.gaia; |
| 855 } | 856 } |
| 856 profile_user_info.id = account.gaia; | |
| 857 | 857 |
| 858 return RespondNow(OneArgument(profile_user_info.ToValue().release())); | 858 return RespondNow(OneArgument(profile_user_info.ToValue().release())); |
| 859 } | 859 } |
| 860 | 860 |
| 861 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() { | 861 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() { |
| 862 } | 862 } |
| 863 | 863 |
| 864 IdentityRemoveCachedAuthTokenFunction:: | 864 IdentityRemoveCachedAuthTokenFunction:: |
| 865 ~IdentityRemoveCachedAuthTokenFunction() { | 865 ~IdentityRemoveCachedAuthTokenFunction() { |
| 866 } | 866 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { | 953 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { |
| 954 SetResult(new base::StringValue(redirect_url.spec())); | 954 SetResult(new base::StringValue(redirect_url.spec())); |
| 955 SendResponse(true); | 955 SendResponse(true); |
| 956 if (auth_flow_) | 956 if (auth_flow_) |
| 957 auth_flow_.release()->DetachDelegateAndDelete(); | 957 auth_flow_.release()->DetachDelegateAndDelete(); |
| 958 Release(); // Balanced in RunAsync. | 958 Release(); // Balanced in RunAsync. |
| 959 } | 959 } |
| 960 } | 960 } |
| 961 | 961 |
| 962 } // namespace extensions | 962 } // namespace extensions |
| OLD | NEW |