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

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

Issue 13945023: Make URLDataSource::GetSource() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another one. Created 7 years, 8 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/theme_source.h ('k') | chrome/test/base/web_ui_browsertest.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/theme_source.h" 5 #include "chrome/browser/ui/webui/theme_source.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 ThemeSource::ThemeSource(Profile* profile) 44 ThemeSource::ThemeSource(Profile* profile)
45 : profile_(profile->GetOriginalProfile()) { 45 : profile_(profile->GetOriginalProfile()) {
46 css_bytes_ = NTPResourceCacheFactory::GetForProfile(profile)->GetNewTabCSS( 46 css_bytes_ = NTPResourceCacheFactory::GetForProfile(profile)->GetNewTabCSS(
47 profile->IsOffTheRecord()); 47 profile->IsOffTheRecord());
48 } 48 }
49 49
50 ThemeSource::~ThemeSource() { 50 ThemeSource::~ThemeSource() {
51 } 51 }
52 52
53 std::string ThemeSource::GetSource() { 53 std::string ThemeSource::GetSource() const {
54 return chrome::kChromeUIThemePath; 54 return chrome::kChromeUIThemePath;
55 } 55 }
56 56
57 void ThemeSource::StartDataRequest( 57 void ThemeSource::StartDataRequest(
58 const std::string& path, 58 const std::string& path,
59 bool is_incognito, 59 bool is_incognito,
60 const content::URLDataSource::GotDataCallback& callback) { 60 const content::URLDataSource::GotDataCallback& callback) {
61 // Default scale factor if not specified. 61 // Default scale factor if not specified.
62 ui::ScaleFactor scale_factor; 62 ui::ScaleFactor scale_factor;
63 std::string uncached_path; 63 std::string uncached_path;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData( 145 scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData(
146 resource_id, scale_factor)); 146 resource_id, scale_factor));
147 callback.Run(image_data); 147 callback.Run(image_data);
148 } else { 148 } else {
149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
150 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 150 const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
151 callback.Run(rb.LoadDataResourceBytesForScale(resource_id, scale_factor)); 151 callback.Run(rb.LoadDataResourceBytesForScale(resource_id, scale_factor));
152 } 152 }
153 } 153 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/theme_source.h ('k') | chrome/test/base/web_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698