| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/user_manager_ui.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_ui.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" | 9 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
| 10 #include "chrome/browser/ui/webui/theme_source.h" | 10 #include "chrome/browser/ui/webui/theme_source.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #endif | 40 #endif |
| 41 } | 41 } |
| 42 | 42 |
| 43 UserManagerUI::~UserManagerUI() { | 43 UserManagerUI::~UserManagerUI() { |
| 44 } | 44 } |
| 45 | 45 |
| 46 content::WebUIDataSource* UserManagerUI::CreateUIDataSource( | 46 content::WebUIDataSource* UserManagerUI::CreateUIDataSource( |
| 47 const base::DictionaryValue& localized_strings) { | 47 const base::DictionaryValue& localized_strings) { |
| 48 content::WebUIDataSource* source = | 48 content::WebUIDataSource* source = |
| 49 content::WebUIDataSource::Create(chrome::kChromeUIUserManagerHost); | 49 content::WebUIDataSource::Create(chrome::kChromeUIUserManagerHost); |
| 50 source->SetUseJsonJSFormatV2(); | |
| 51 source->AddLocalizedStrings(localized_strings); | 50 source->AddLocalizedStrings(localized_strings); |
| 52 source->SetJsonPath(kStringsJSPath); | 51 source->SetJsonPath(kStringsJSPath); |
| 53 | 52 |
| 54 source->SetDefaultResource(IDR_USER_MANAGER_HTML); | 53 source->SetDefaultResource(IDR_USER_MANAGER_HTML); |
| 55 source->AddResourcePath(kUserManagerJSPath, IDR_USER_MANAGER_JS); | 54 source->AddResourcePath(kUserManagerJSPath, IDR_USER_MANAGER_JS); |
| 56 | 55 |
| 57 return source; | 56 return source; |
| 58 } | 57 } |
| 59 | 58 |
| 60 void UserManagerUI::GetLocalizedStrings( | 59 void UserManagerUI::GetLocalizedStrings( |
| 61 base::DictionaryValue* localized_strings) { | 60 base::DictionaryValue* localized_strings) { |
| 62 user_manager_screen_handler_->GetLocalizedValues(localized_strings); | 61 user_manager_screen_handler_->GetLocalizedValues(localized_strings); |
| 63 webui::SetFontAndTextDirection(localized_strings); | 62 webui::SetFontAndTextDirection(localized_strings); |
| 64 | 63 |
| 65 #if defined(GOOGLE_CHROME_BUILD) | 64 #if defined(GOOGLE_CHROME_BUILD) |
| 66 localized_strings->SetString("buildType", "chrome"); | 65 localized_strings->SetString("buildType", "chrome"); |
| 67 #else | 66 #else |
| 68 localized_strings->SetString("buildType", "chromium"); | 67 localized_strings->SetString("buildType", "chromium"); |
| 69 #endif | 68 #endif |
| 70 } | 69 } |
| 71 | 70 |
| OLD | NEW |