| 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/ui/webui/signin_internals_ui.h" | 5 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
| 6 | 6 |
| 7 #include "base/hash.h" | 7 #include "base/hash.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/about_signin_internals_factory.h" | 10 #include "chrome/browser/signin/about_signin_internals_factory.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 AboutSigninInternalsFactory::GetForProfile(profile); | 66 AboutSigninInternalsFactory::GetForProfile(profile); |
| 67 // TODO(vishwath): The UI would look better if we passed in a dict with some | 67 // TODO(vishwath): The UI would look better if we passed in a dict with some |
| 68 // reasonable defaults, so the about:signin-internals page doesn't look | 68 // reasonable defaults, so the about:signin-internals page doesn't look |
| 69 // empty in incognito mode. Alternatively, we could force about:signin to | 69 // empty in incognito mode. Alternatively, we could force about:signin to |
| 70 // open in non-incognito mode always (like about:settings for ex.). | 70 // open in non-incognito mode always (like about:settings for ex.). |
| 71 if (about_signin_internals) { | 71 if (about_signin_internals) { |
| 72 web_ui()->CallJavascriptFunction( | 72 web_ui()->CallJavascriptFunction( |
| 73 "chrome.signin.getSigninInfo.handleReply", | 73 "chrome.signin.getSigninInfo.handleReply", |
| 74 *about_signin_internals->GetSigninStatus()); | 74 *about_signin_internals->GetSigninStatus()); |
| 75 | 75 |
| 76 std::vector<std::pair<std::string, bool>> cookie_accounts; | 76 std::vector<gaia::ListedAccount> cookie_accounts; |
| 77 GaiaCookieManagerService* cookie_manager_service = | 77 GaiaCookieManagerService* cookie_manager_service = |
| 78 GaiaCookieManagerServiceFactory::GetForProfile(profile); | 78 GaiaCookieManagerServiceFactory::GetForProfile(profile); |
| 79 if (cookie_manager_service->ListAccounts(&cookie_accounts)) { | 79 if (cookie_manager_service->ListAccounts(&cookie_accounts)) { |
| 80 about_signin_internals->OnGaiaAccountsInCookieUpdated( | 80 about_signin_internals->OnGaiaAccountsInCookieUpdated( |
| 81 cookie_accounts, | 81 cookie_accounts, |
| 82 GoogleServiceAuthError(GoogleServiceAuthError::NONE)); | 82 GoogleServiceAuthError(GoogleServiceAuthError::NONE)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 98 | 98 |
| 99 web_ui()->CallJavascriptFunction( | 99 web_ui()->CallJavascriptFunction( |
| 100 "chrome.signin.onSigninInfoChanged.fire", *info); | 100 "chrome.signin.onSigninInfoChanged.fire", *info); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void SignInInternalsUI::OnCookieAccountsFetched( | 103 void SignInInternalsUI::OnCookieAccountsFetched( |
| 104 const base::DictionaryValue* info) { | 104 const base::DictionaryValue* info) { |
| 105 web_ui()->CallJavascriptFunction( | 105 web_ui()->CallJavascriptFunction( |
| 106 "chrome.signin.onCookieAccountsFetched.fire", *info); | 106 "chrome.signin.onCookieAccountsFetched.fire", *info); |
| 107 } | 107 } |
| OLD | NEW |