Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/ui/webui/options/options_ui.cc

Issue 880313002: webui: add [lang] attribute to <html> element on all webui pages so (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cros Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/options/options_ui.h" 5 #include "chrome/browser/ui/webui/options/options_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 std::string OptionsUIHTMLSource::GetSource() const { 157 std::string OptionsUIHTMLSource::GetSource() const {
158 return chrome::kChromeUISettingsFrameHost; 158 return chrome::kChromeUISettingsFrameHost;
159 } 159 }
160 160
161 void OptionsUIHTMLSource::StartDataRequest( 161 void OptionsUIHTMLSource::StartDataRequest(
162 const std::string& path, 162 const std::string& path,
163 int render_process_id, 163 int render_process_id,
164 int render_frame_id, 164 int render_frame_id,
165 const content::URLDataSource::GotDataCallback& callback) { 165 const content::URLDataSource::GotDataCallback& callback) {
166 scoped_refptr<base::RefCountedMemory> response_bytes; 166 scoped_refptr<base::RefCountedMemory> response_bytes;
167 webui::SetFontAndTextDirection(localized_strings_.get()); 167 const std::string& app_locale = g_browser_process->GetApplicationLocale();
168 webui::SetLoadTimeDataDefaults(app_locale, localized_strings_.get());
168 169
169 if (path == kLocalizedStringsFile) { 170 if (path == kLocalizedStringsFile) {
170 // Return dynamically-generated strings from memory. 171 // Return dynamically-generated strings from memory.
171 std::string strings_js; 172 std::string strings_js;
172 webui::AppendJsonJS(localized_strings_.get(), &strings_js); 173 webui::AppendJsonJS(localized_strings_.get(), &strings_js);
173 response_bytes = base::RefCountedString::TakeString(&strings_js); 174 response_bytes = base::RefCountedString::TakeString(&strings_js);
174 } else if (path == kOptionsBundleJsFile) { 175 } else if (path == kOptionsBundleJsFile) {
175 // Return (and cache) the options javascript code. 176 // Return (and cache) the options javascript code.
176 response_bytes = ui::ResourceBundle::GetSharedInstance(). 177 response_bytes = ui::ResourceBundle::GetSharedInstance().
177 LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS); 178 LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // Add only if handler's service is enabled. 478 // Add only if handler's service is enabled.
478 if (handler->IsEnabled()) { 479 if (handler->IsEnabled()) {
479 // Add handler to the list and also pass the ownership. 480 // Add handler to the list and also pass the ownership.
480 web_ui()->AddMessageHandler(handler.release()); 481 web_ui()->AddMessageHandler(handler.release());
481 handler_raw->GetLocalizedValues(localized_strings); 482 handler_raw->GetLocalizedValues(localized_strings);
482 handlers_.push_back(handler_raw); 483 handlers_.push_back(handler_raw);
483 } 484 }
484 } 485 }
485 486
486 } // namespace options 487 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/browser/ui/webui/signin/user_manager_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698