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.h" | 9 #include "chrome/browser/signin/about_signin_internals.h" |
10 #include "chrome/browser/signin/about_signin_internals_factory.h" | 10 #include "chrome/browser/signin/about_signin_internals_factory.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 IDR_SIGNIN_INTERNALS_INDEX_JS); | 27 IDR_SIGNIN_INTERNALS_INDEX_JS); |
28 source->set_default_resource(IDR_SIGNIN_INTERNALS_INDEX_HTML); | 28 source->set_default_resource(IDR_SIGNIN_INTERNALS_INDEX_HTML); |
29 return source; | 29 return source; |
30 } | 30 } |
31 | 31 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui) | 34 SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui) |
35 : WebUIController(web_ui) { | 35 : WebUIController(web_ui) { |
36 Profile* profile = Profile::FromWebUI(web_ui); | 36 Profile* profile = Profile::FromWebUI(web_ui); |
37 ChromeURLDataManager::AddDataSource(profile, | 37 ChromeURLDataManager::AddDataSourceImpl( |
38 CreateSignInInternalsHTMLSource()); | 38 profile, CreateSignInInternalsHTMLSource()); |
39 if (profile) { | 39 if (profile) { |
40 AboutSigninInternals* about_signin_internals = | 40 AboutSigninInternals* about_signin_internals = |
41 AboutSigninInternalsFactory::GetForProfile(profile); | 41 AboutSigninInternalsFactory::GetForProfile(profile); |
42 if (about_signin_internals) | 42 if (about_signin_internals) |
43 about_signin_internals->AddSigninObserver(this); | 43 about_signin_internals->AddSigninObserver(this); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 SignInInternalsUI::~SignInInternalsUI() { | 47 SignInInternalsUI::~SignInInternalsUI() { |
48 Profile* profile = Profile::FromWebUI(web_ui()); | 48 Profile* profile = Profile::FromWebUI(web_ui()); |
(...skipping 29 matching lines...) Expand all Loading... |
78 return true; | 78 return true; |
79 } | 79 } |
80 } | 80 } |
81 return false; | 81 return false; |
82 } | 82 } |
83 | 83 |
84 void SignInInternalsUI::OnSigninStateChanged(scoped_ptr<DictionaryValue> info) { | 84 void SignInInternalsUI::OnSigninStateChanged(scoped_ptr<DictionaryValue> info) { |
85 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire"; | 85 const std::string& event_handler = "chrome.signin.onSigninInfoChanged.fire"; |
86 web_ui()->CallJavascriptFunction(event_handler, *info); | 86 web_ui()->CallJavascriptFunction(event_handler, *info); |
87 } | 87 } |
OLD | NEW |