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

Side by Side Diff: chrome/browser/ui/webui/chrome_web_ui_data_source.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
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chrome_web_ui_data_source.h" 5 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 resource_id = result->second; 144 resource_id = result->second;
145 DCHECK_NE(resource_id, -1); 145 DCHECK_NE(resource_id, -1);
146 SendFromResourceBundle(callback, resource_id); 146 SendFromResourceBundle(callback, resource_id);
147 } 147 }
148 148
149 void ChromeWebUIDataSource::SendLocalizedStringsAsJSON( 149 void ChromeWebUIDataSource::SendLocalizedStringsAsJSON(
150 const content::URLDataSource::GotDataCallback& callback) { 150 const content::URLDataSource::GotDataCallback& callback) {
151 std::string template_data; 151 std::string template_data;
152 web_ui_util::SetFontAndTextDirection(&localized_strings_); 152 web_ui_util::SetFontAndTextDirection(&localized_strings_);
153 153
154 scoped_ptr<jstemplate_builder::UseVersion2> version2; 154 scoped_ptr<webui::UseVersion2> version2;
155 if (json_js_format_v2_) 155 if (json_js_format_v2_)
156 version2.reset(new jstemplate_builder::UseVersion2); 156 version2.reset(new webui::UseVersion2);
157 157
158 jstemplate_builder::AppendJsonJS(&localized_strings_, &template_data); 158 webui::AppendJsonJS(&localized_strings_, &template_data);
159 callback.Run(base::RefCountedString::TakeString(&template_data)); 159 callback.Run(base::RefCountedString::TakeString(&template_data));
160 } 160 }
161 161
162 void ChromeWebUIDataSource::SendFromResourceBundle( 162 void ChromeWebUIDataSource::SendFromResourceBundle(
163 const content::URLDataSource::GotDataCallback& callback, int idr) { 163 const content::URLDataSource::GotDataCallback& callback, int idr) {
164 scoped_refptr<base::RefCountedStaticMemory> response( 164 scoped_refptr<base::RefCountedStaticMemory> response(
165 ResourceBundle::GetSharedInstance().LoadDataResourceBytes( 165 ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
166 idr)); 166 idr));
167 callback.Run(response); 167 callback.Run(response);
168 } 168 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698