| 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" |
| 11 #include "components/signin/core/browser/about_signin_internals.h" | 11 #include "components/signin/core/browser/about_signin_internals.h" |
| 12 #include "content/public/browser/web_ui.h" | 12 #include "content/public/browser/web_ui.h" |
| 13 #include "content/public/browser/web_ui_data_source.h" | 13 #include "content/public/browser/web_ui_data_source.h" |
| 14 #include "grit/signin_internals_resources.h" | 14 #include "grit/signin_internals_resources.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 content::WebUIDataSource* CreateSignInInternalsHTMLSource() { | 18 content::WebUIDataSource* CreateSignInInternalsHTMLSource() { |
| 19 content::WebUIDataSource* source = | 19 content::WebUIDataSource* source = |
| 20 content::WebUIDataSource::Create(chrome::kChromeUISignInInternalsHost); | 20 content::WebUIDataSource::Create(chrome::kChromeUISignInInternalsHost); |
| 21 | 21 |
| 22 source->SetUseJsonJSFormatV2(); | |
| 23 source->SetJsonPath("strings.js"); | 22 source->SetJsonPath("strings.js"); |
| 24 source->AddResourcePath("signin_internals.js", IDR_SIGNIN_INTERNALS_INDEX_JS); | 23 source->AddResourcePath("signin_internals.js", IDR_SIGNIN_INTERNALS_INDEX_JS); |
| 25 source->SetDefaultResource(IDR_SIGNIN_INTERNALS_INDEX_HTML); | 24 source->SetDefaultResource(IDR_SIGNIN_INTERNALS_INDEX_HTML); |
| 26 return source; | 25 return source; |
| 27 } | 26 } |
| 28 | 27 |
| 29 } // namespace | 28 } // namespace |
| 30 | 29 |
| 31 SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui) | 30 SignInInternalsUI::SignInInternalsUI(content::WebUI* web_ui) |
| 32 : WebUIController(web_ui) { | 31 : WebUIController(web_ui) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 scoped_ptr<base::DictionaryValue> info) { | 81 scoped_ptr<base::DictionaryValue> info) { |
| 83 web_ui()->CallJavascriptFunction( | 82 web_ui()->CallJavascriptFunction( |
| 84 "chrome.signin.onSigninInfoChanged.fire", *info); | 83 "chrome.signin.onSigninInfoChanged.fire", *info); |
| 85 } | 84 } |
| 86 | 85 |
| 87 void SignInInternalsUI::OnCookieAccountsFetched( | 86 void SignInInternalsUI::OnCookieAccountsFetched( |
| 88 scoped_ptr<base::DictionaryValue> info) { | 87 scoped_ptr<base::DictionaryValue> info) { |
| 89 web_ui()->CallJavascriptFunction( | 88 web_ui()->CallJavascriptFunction( |
| 90 "chrome.signin.onCookieAccountsFetched.fire", *info); | 89 "chrome.signin.onCookieAccountsFetched.fire", *info); |
| 91 } | 90 } |
| OLD | NEW |