| 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" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 12 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" | 13 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" |
| 13 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" | 14 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
| 14 #include "chrome/browser/ui/webui/theme_source.h" | 15 #include "chrome/browser/ui/webui/theme_source.h" |
| 15 #include "chrome/common/features.h" | 16 #include "chrome/common/features.h" |
| 16 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 17 #include "chrome/grit/browser_resources.h" | 18 #include "chrome/grit/browser_resources.h" |
| 18 #include "chrome/grit/settings_resources.h" | 19 #include "chrome/grit/settings_resources.h" |
| 19 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
| 20 #include "content/public/browser/web_ui_data_source.h" | 21 #include "content/public/browser/web_ui_data_source.h" |
| 21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #endif | 54 #endif |
| 54 } | 55 } |
| 55 | 56 |
| 56 MDUserManagerUI::~MDUserManagerUI() {} | 57 MDUserManagerUI::~MDUserManagerUI() {} |
| 57 | 58 |
| 58 content::WebUIDataSource* MDUserManagerUI::CreateUIDataSource( | 59 content::WebUIDataSource* MDUserManagerUI::CreateUIDataSource( |
| 59 const base::DictionaryValue& localized_strings) { | 60 const base::DictionaryValue& localized_strings) { |
| 60 content::WebUIDataSource* source = | 61 content::WebUIDataSource* source = |
| 61 content::WebUIDataSource::Create(chrome::kChromeUIMdUserManagerHost); | 62 content::WebUIDataSource::Create(chrome::kChromeUIMdUserManagerHost); |
| 62 source->AddLocalizedStrings(localized_strings); | 63 source->AddLocalizedStrings(localized_strings); |
| 64 source->AddBoolean("profileShortcutsEnabled", |
| 65 ProfileShortcutManager::IsFeatureEnabled()); |
| 66 |
| 63 source->SetJsonPath("strings.js"); | 67 source->SetJsonPath("strings.js"); |
| 64 | 68 |
| 65 source->AddResourcePath("control_bar.html", IDR_MD_CONTROL_BAR_HTML); | 69 source->AddResourcePath("control_bar.html", IDR_MD_CONTROL_BAR_HTML); |
| 66 source->AddResourcePath("control_bar.js", IDR_MD_CONTROL_BAR_JS); | 70 source->AddResourcePath("control_bar.js", IDR_MD_CONTROL_BAR_JS); |
| 67 source->AddResourcePath("create_profile.html", IDR_MD_CREATE_PROFILE_HTML); | 71 source->AddResourcePath("create_profile.html", IDR_MD_CREATE_PROFILE_HTML); |
| 68 source->AddResourcePath("create_profile.js", IDR_MD_CREATE_PROFILE_JS); | 72 source->AddResourcePath("create_profile.js", IDR_MD_CREATE_PROFILE_JS); |
| 69 source->AddResourcePath("error_dialog.html", IDR_MD_ERROR_DIALOG_HTML); | 73 source->AddResourcePath("error_dialog.html", IDR_MD_ERROR_DIALOG_HTML); |
| 70 source->AddResourcePath("error_dialog.js", IDR_MD_ERROR_DIALOG_JS); | 74 source->AddResourcePath("error_dialog.js", IDR_MD_ERROR_DIALOG_JS); |
| 71 source->AddResourcePath("icons.html", IDR_MD_USER_MANAGER_ICONS_HTML); | 75 source->AddResourcePath("icons.html", IDR_MD_USER_MANAGER_ICONS_HTML); |
| 72 source->AddResourcePath("import_supervised_user.html", | 76 source->AddResourcePath("import_supervised_user.html", |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 #endif | 120 #endif |
| 117 const std::string& app_locale = g_browser_process->GetApplicationLocale(); | 121 const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
| 118 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); | 122 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); |
| 119 | 123 |
| 120 #if defined(GOOGLE_CHROME_BUILD) | 124 #if defined(GOOGLE_CHROME_BUILD) |
| 121 localized_strings->SetString("buildType", "chrome"); | 125 localized_strings->SetString("buildType", "chrome"); |
| 122 #else | 126 #else |
| 123 localized_strings->SetString("buildType", "chromium"); | 127 localized_strings->SetString("buildType", "chromium"); |
| 124 #endif | 128 #endif |
| 125 } | 129 } |
| OLD | NEW |