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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if (!profile) | 61 if (!profile) |
62 return false; | 62 return false; |
63 | 63 |
64 AboutSigninInternals* about_signin_internals = | 64 AboutSigninInternals* about_signin_internals = |
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 = | |
72 "chrome.signin.getSigninInfo.handleReply"; | |
73 web_ui()->CallJavascriptFunction( | 71 web_ui()->CallJavascriptFunction( |
74 reply_handler, *about_signin_internals->GetSigninStatus()); | 72 "chrome.signin.getSigninInfo.handleReply", |
| 73 *about_signin_internals->GetSigninStatus()); |
| 74 about_signin_internals->GetCookieAccountsAsync(); |
75 | 75 |
76 return true; | 76 return true; |
77 } | 77 } |
78 } | 78 } |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
82 void SignInInternalsUI::OnSigninStateChanged( | 82 void SignInInternalsUI::OnSigninStateChanged( |
83 scoped_ptr<base::DictionaryValue> info) { | 83 scoped_ptr<base::DictionaryValue> info) { |
84 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire"; | 84 web_ui()->CallJavascriptFunction( |
85 web_ui()->CallJavascriptFunction(event_handler, *info); | 85 "chrome.signin.onSigninInfoChanged.fire", *info); |
86 } | 86 } |
| 87 |
| 88 void SignInInternalsUI::OnCookieAccountsFetched( |
| 89 scoped_ptr<base::DictionaryValue> info) { |
| 90 web_ui()->CallJavascriptFunction( |
| 91 "chrome.signin.onCookieAccountsFetched.fire", *info); |
| 92 } |
OLD | NEW |