| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 MDUserManagerUI::~MDUserManagerUI() {} | 46 MDUserManagerUI::~MDUserManagerUI() {} |
| 47 | 47 |
| 48 content::WebUIDataSource* MDUserManagerUI::CreateUIDataSource( | 48 content::WebUIDataSource* MDUserManagerUI::CreateUIDataSource( |
| 49 const base::DictionaryValue& localized_strings) { | 49 const base::DictionaryValue& localized_strings) { |
| 50 content::WebUIDataSource* source = | 50 content::WebUIDataSource* source = |
| 51 content::WebUIDataSource::Create(chrome::kChromeUIMdUserManagerHost); | 51 content::WebUIDataSource::Create(chrome::kChromeUIMdUserManagerHost); |
| 52 source->AddLocalizedStrings(localized_strings); | 52 source->AddLocalizedStrings(localized_strings); |
| 53 source->SetJsonPath("strings.js"); | 53 source->SetJsonPath("strings.js"); |
| 54 | 54 |
| 55 // TODO(mahmadi): Add resource paths. | 55 source->AddResourcePath("control_bar.css", IDR_MD_CONTROL_BAR_CSS); |
| 56 source->AddResourcePath("control_bar.html", IDR_MD_CONTROL_BAR_HTML); |
| 57 source->AddResourcePath("control_bar.js", IDR_MD_CONTROL_BAR_JS); |
| 58 source->AddResourcePath("create_profile.css", IDR_MD_CREATE_PROFILE_CSS); |
| 59 source->AddResourcePath("create_profile.html", IDR_MD_CREATE_PROFILE_HTML); |
| 60 source->AddResourcePath("create_profile.js", IDR_MD_CREATE_PROFILE_JS); |
| 61 source->AddResourcePath("profile_api.html", IDR_MD_PROFILE_API_HTML); |
| 62 source->AddResourcePath("profile_api.js", IDR_MD_PROFILE_API_JS); |
| 63 source->AddResourcePath("strings.html", IDR_MD_USER_MANAGER_STRINGS_HTML); |
| 64 source->AddResourcePath("user_manager.css", IDR_MD_USER_MANAGER_CSS); |
| 65 source->AddResourcePath("user_manager.js", IDR_MD_USER_MANAGER_JS); |
| 66 source->AddResourcePath("user_manager_pages.css", |
| 67 IDR_MD_USER_MANAGER_PAGES_CSS); |
| 68 source->AddResourcePath("user_manager_pages.html", |
| 69 IDR_MD_USER_MANAGER_PAGES_HTML); |
| 70 source->AddResourcePath("user_manager_pages.js", |
| 71 IDR_MD_USER_MANAGER_PAGES_JS); |
| 72 |
| 73 source->SetDefaultResource(IDR_MD_USER_MANAGER_HTML); |
| 56 | 74 |
| 57 return source; | 75 return source; |
| 58 } | 76 } |
| 59 | 77 |
| 60 void MDUserManagerUI::GetLocalizedStrings( | 78 void MDUserManagerUI::GetLocalizedStrings( |
| 61 base::DictionaryValue* localized_strings) { | 79 base::DictionaryValue* localized_strings) { |
| 62 user_manager_screen_handler_->GetLocalizedValues(localized_strings); | 80 user_manager_screen_handler_->GetLocalizedValues(localized_strings); |
| 63 signin_create_profile_handler_->GetLocalizedValues(localized_strings); | 81 signin_create_profile_handler_->GetLocalizedValues(localized_strings); |
| 64 const std::string& app_locale = g_browser_process->GetApplicationLocale(); | 82 const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
| 65 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); | 83 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); |
| 66 | 84 |
| 67 #if defined(GOOGLE_CHROME_BUILD) | 85 #if defined(GOOGLE_CHROME_BUILD) |
| 68 localized_strings->SetString("buildType", "chrome"); | 86 localized_strings->SetString("buildType", "chrome"); |
| 69 #else | 87 #else |
| 70 localized_strings->SetString("buildType", "chromium"); | 88 localized_strings->SetString("buildType", "chromium"); |
| 71 #endif | 89 #endif |
| 72 } | 90 } |
| OLD | NEW |