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

Side by Side Diff: chrome/browser/ui/webui/chrome_web_ui_data_source.cc

Issue 11929016: Move jstemplate_builder.* to ui\webui so it can be reused by webui implementations outside of chrom… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to 177705 to get yfriendman's fix 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/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"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "chrome/browser/ui/webui/web_ui_util.h" 12 #include "chrome/browser/ui/webui/web_ui_util.h"
13 #include "chrome/common/jstemplate_builder.h"
14 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
15 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/webui/jstemplate_builder.h"
16 16
17 // Internal class to hide the fact that ChromeWebUIDataSource implements 17 // Internal class to hide the fact that ChromeWebUIDataSource implements
18 // content::URLDataSource. 18 // content::URLDataSource.
19 class ChromeWebUIDataSource::InternalDataSource 19 class ChromeWebUIDataSource::InternalDataSource
20 : public content::URLDataSource { 20 : public content::URLDataSource {
21 public: 21 public:
22 InternalDataSource(ChromeWebUIDataSource* parent) : parent_(parent) { 22 InternalDataSource(ChromeWebUIDataSource* parent) : parent_(parent) {
23 } 23 }
24 24
25 ~InternalDataSource() { 25 ~InternalDataSource() {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 callback.Run(base::RefCountedString::TakeString(&template_data)); 133 callback.Run(base::RefCountedString::TakeString(&template_data));
134 } 134 }
135 135
136 void ChromeWebUIDataSource::SendFromResourceBundle( 136 void ChromeWebUIDataSource::SendFromResourceBundle(
137 const content::URLDataSource::GotDataCallback& callback, int idr) { 137 const content::URLDataSource::GotDataCallback& callback, int idr) {
138 scoped_refptr<base::RefCountedStaticMemory> response( 138 scoped_refptr<base::RefCountedStaticMemory> response(
139 ResourceBundle::GetSharedInstance().LoadDataResourceBytes( 139 ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
140 idr)); 140 idr));
141 callback.Run(response); 141 callback.Run(response);
142 } 142 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698