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

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

Issue 12045022: Move code in ui\webui\jstemplate_builder.* to webui namespace for consistency. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
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/callback.h" 10 #include "base/callback.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 void OptionsUIHTMLSource::StartDataRequest( 136 void OptionsUIHTMLSource::StartDataRequest(
137 const std::string& path, 137 const std::string& path,
138 bool is_incognito, 138 bool is_incognito,
139 const content::URLDataSource::GotDataCallback& callback) { 139 const content::URLDataSource::GotDataCallback& callback) {
140 scoped_refptr<base::RefCountedMemory> response_bytes; 140 scoped_refptr<base::RefCountedMemory> response_bytes;
141 web_ui_util::SetFontAndTextDirection(localized_strings_.get()); 141 web_ui_util::SetFontAndTextDirection(localized_strings_.get());
142 142
143 if (path == kLocalizedStringsFile) { 143 if (path == kLocalizedStringsFile) {
144 // Return dynamically-generated strings from memory. 144 // Return dynamically-generated strings from memory.
145 jstemplate_builder::UseVersion2 version; 145 webui::UseVersion2 version;
146 std::string strings_js; 146 std::string strings_js;
147 jstemplate_builder::AppendJsonJS(localized_strings_.get(), &strings_js); 147 webui::AppendJsonJS(localized_strings_.get(), &strings_js);
148 response_bytes = base::RefCountedString::TakeString(&strings_js); 148 response_bytes = base::RefCountedString::TakeString(&strings_js);
149 } else if (path == kOptionsBundleJsFile) { 149 } else if (path == kOptionsBundleJsFile) {
150 // Return (and cache) the options javascript code. 150 // Return (and cache) the options javascript code.
151 response_bytes = ui::ResourceBundle::GetSharedInstance(). 151 response_bytes = ui::ResourceBundle::GetSharedInstance().
152 LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS); 152 LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS);
153 } else { 153 } else {
154 // Return (and cache) the main options html page as the default. 154 // Return (and cache) the main options html page as the default.
155 response_bytes = ui::ResourceBundle::GetSharedInstance(). 155 response_bytes = ui::ResourceBundle::GetSharedInstance().
156 LoadDataResourceBytes(IDR_OPTIONS_HTML); 156 LoadDataResourceBytes(IDR_OPTIONS_HTML);
157 } 157 }
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // Add only if handler's service is enabled. 409 // Add only if handler's service is enabled.
410 if (handler->IsEnabled()) { 410 if (handler->IsEnabled()) {
411 // Add handler to the list and also pass the ownership. 411 // Add handler to the list and also pass the ownership.
412 web_ui()->AddMessageHandler(handler.release()); 412 web_ui()->AddMessageHandler(handler.release());
413 handler_raw->GetLocalizedValues(localized_strings); 413 handler_raw->GetLocalizedValues(localized_strings);
414 handlers_.push_back(handler_raw); 414 handlers_.push_back(handler_raw);
415 } 415 }
416 } 416 }
417 417
418 } // namespace options 418 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc ('k') | chrome/common/net/net_resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698