OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/md_user_manager_ui.h" | 5 #include "chrome/browser/ui/webui/signin/md_user_manager_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 web_ui->AddMessageHandler(signin_supervised_user_import_handler_); | 41 web_ui->AddMessageHandler(signin_supervised_user_import_handler_); |
42 #endif | 42 #endif |
43 | 43 |
44 base::DictionaryValue localized_strings; | 44 base::DictionaryValue localized_strings; |
45 GetLocalizedStrings(&localized_strings); | 45 GetLocalizedStrings(&localized_strings); |
46 | 46 |
47 Profile* profile = Profile::FromWebUI(web_ui); | 47 Profile* profile = Profile::FromWebUI(web_ui); |
48 // Set up the chrome://md-user-manager/ source. | 48 // Set up the chrome://md-user-manager/ source. |
49 content::WebUIDataSource::Add(profile, CreateUIDataSource(localized_strings)); | 49 content::WebUIDataSource::Add(profile, CreateUIDataSource(localized_strings)); |
50 | 50 |
51 #if defined(ENABLE_THEMES) | |
52 // Set up the chrome://theme/ source | 51 // Set up the chrome://theme/ source |
53 ThemeSource* theme = new ThemeSource(profile); | 52 ThemeSource* theme = new ThemeSource(profile); |
54 content::URLDataSource::Add(profile, theme); | 53 content::URLDataSource::Add(profile, theme); |
55 #endif | |
56 } | 54 } |
57 | 55 |
58 MDUserManagerUI::~MDUserManagerUI() {} | 56 MDUserManagerUI::~MDUserManagerUI() {} |
59 | 57 |
60 content::WebUIDataSource* MDUserManagerUI::CreateUIDataSource( | 58 content::WebUIDataSource* MDUserManagerUI::CreateUIDataSource( |
61 const base::DictionaryValue& localized_strings) { | 59 const base::DictionaryValue& localized_strings) { |
62 content::WebUIDataSource* source = | 60 content::WebUIDataSource* source = |
63 content::WebUIDataSource::Create(chrome::kChromeUIMdUserManagerHost); | 61 content::WebUIDataSource::Create(chrome::kChromeUIMdUserManagerHost); |
64 source->AddLocalizedStrings(localized_strings); | 62 source->AddLocalizedStrings(localized_strings); |
65 source->AddBoolean("profileShortcutsEnabled", | 63 source->AddBoolean("profileShortcutsEnabled", |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 #endif | 120 #endif |
123 const std::string& app_locale = g_browser_process->GetApplicationLocale(); | 121 const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
124 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); | 122 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); |
125 | 123 |
126 #if defined(GOOGLE_CHROME_BUILD) | 124 #if defined(GOOGLE_CHROME_BUILD) |
127 localized_strings->SetString("buildType", "chrome"); | 125 localized_strings->SetString("buildType", "chrome"); |
128 #else | 126 #else |
129 localized_strings->SetString("buildType", "chromium"); | 127 localized_strings->SetString("buildType", "chromium"); |
130 #endif | 128 #endif |
131 } | 129 } |
OLD | NEW |