| 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 "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/signin/about_signin_internals_factory.h" | 9 #include "chrome/browser/signin/about_signin_internals_factory.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 AboutSigninInternalsFactory::GetForProfile(profile); | 65 AboutSigninInternalsFactory::GetForProfile(profile); |
| 66 // TODO(vishwath): The UI would look better if we passed in a dict with some | 66 // TODO(vishwath): The UI would look better if we passed in a dict with some |
| 67 // reasonable defaults, so the about:signin-internals page doesn't look | 67 // reasonable defaults, so the about:signin-internals page doesn't look |
| 68 // empty in incognito mode. Alternatively, we could force about:signin to | 68 // empty in incognito mode. Alternatively, we could force about:signin to |
| 69 // open in non-incognito mode always (like about:settings for ex.). | 69 // open in non-incognito mode always (like about:settings for ex.). |
| 70 if (about_signin_internals) { | 70 if (about_signin_internals) { |
| 71 const std::string& reply_handler = | 71 const std::string& reply_handler = |
| 72 "chrome.signin.getSigninInfo.handleReply"; | 72 "chrome.signin.getSigninInfo.handleReply"; |
| 73 web_ui()->CallJavascriptFunction( | 73 web_ui()->CallJavascriptFunction( |
| 74 reply_handler, *about_signin_internals->GetSigninStatus()); | 74 reply_handler, *about_signin_internals->GetSigninStatus()); |
| 75 about_signin_internals->GetCookieAccountsAsync(); |
| 75 | 76 |
| 76 return true; | 77 return true; |
| 77 } | 78 } |
| 78 } | 79 } |
| 79 return false; | 80 return false; |
| 80 } | 81 } |
| 81 | 82 |
| 82 void SignInInternalsUI::OnSigninStateChanged( | 83 void SignInInternalsUI::OnSigninStateChanged( |
| 83 scoped_ptr<base::DictionaryValue> info) { | 84 scoped_ptr<base::DictionaryValue> info) { |
| 84 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire"; | 85 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire"; |
| 85 web_ui()->CallJavascriptFunction(event_handler, *info); | 86 web_ui()->CallJavascriptFunction(event_handler, *info); |
| 86 } | 87 } |
| 88 |
| 89 void SignInInternalsUI::OnCookieAccountsFetched( |
| 90 scoped_ptr<base::DictionaryValue> info) { |
| 91 const std::string& event_handler = |
| 92 "chrome.signin.onCookieAccountsFetched.fire"; |
| 93 web_ui()->CallJavascriptFunction(event_handler, *info); |
| 94 } |
| OLD | NEW |