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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 void IdentityAPI::OnAccountRemoved(const gaia::AccountIds& ids) { | 225 void IdentityAPI::OnAccountRemoved(const gaia::AccountIds& ids) { |
226 } | 226 } |
227 | 227 |
228 void IdentityAPI::OnAccountSignInChanged(const gaia::AccountIds& ids, | 228 void IdentityAPI::OnAccountSignInChanged(const gaia::AccountIds& ids, |
229 bool is_signed_in) { | 229 bool is_signed_in) { |
230 api::identity::AccountInfo account_info; | 230 api::identity::AccountInfo account_info; |
231 account_info.id = ids.gaia; | 231 account_info.id = ids.gaia; |
232 | 232 |
233 scoped_ptr<base::ListValue> args = | 233 scoped_ptr<base::ListValue> args = |
234 api::identity::OnSignInChanged::Create(account_info, is_signed_in); | 234 api::identity::OnSignInChanged::Create(account_info, is_signed_in); |
235 scoped_ptr<Event> event(new Event(api::identity::OnSignInChanged::kEventName, | 235 scoped_ptr<Event> event(new Event(events::UNKNOWN, |
236 args.Pass(), | 236 api::identity::OnSignInChanged::kEventName, |
237 browser_context_)); | 237 args.Pass(), browser_context_)); |
238 | 238 |
239 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); | 239 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass()); |
240 } | 240 } |
241 | 241 |
242 void IdentityAPI::AddShutdownObserver(ShutdownObserver* observer) { | 242 void IdentityAPI::AddShutdownObserver(ShutdownObserver* observer) { |
243 shutdown_observer_list_.AddObserver(observer); | 243 shutdown_observer_list_.AddObserver(observer); |
244 } | 244 } |
245 | 245 |
246 void IdentityAPI::RemoveShutdownObserver(ShutdownObserver* observer) { | 246 void IdentityAPI::RemoveShutdownObserver(ShutdownObserver* observer) { |
247 shutdown_observer_list_.RemoveObserver(observer); | 247 shutdown_observer_list_.RemoveObserver(observer); |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { | 969 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { |
970 SetResult(new base::StringValue(redirect_url.spec())); | 970 SetResult(new base::StringValue(redirect_url.spec())); |
971 SendResponse(true); | 971 SendResponse(true); |
972 if (auth_flow_) | 972 if (auth_flow_) |
973 auth_flow_.release()->DetachDelegateAndDelete(); | 973 auth_flow_.release()->DetachDelegateAndDelete(); |
974 Release(); // Balanced in RunAsync. | 974 Release(); // Balanced in RunAsync. |
975 } | 975 } |
976 } | 976 } |
977 | 977 |
978 } // namespace extensions | 978 } // namespace extensions |
OLD | NEW |