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

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

Issue 10783015: Add ability to store hidpi theme images in data pack (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/cocoa/download/background_theme.mm ('k') | ui/base/theme_provider.h » ('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/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // ThemeSource, private: 122 // ThemeSource, private:
123 123
124 void ThemeSource::SendThemeBitmap(int request_id, 124 void ThemeSource::SendThemeBitmap(int request_id,
125 int resource_id, 125 int resource_id,
126 ui::ScaleFactor scale_factor) { 126 ui::ScaleFactor scale_factor) {
127 if (ThemeService::IsThemeableImage(resource_id)) { 127 if (ThemeService::IsThemeableImage(resource_id)) {
128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
129 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_); 129 ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
130 DCHECK(tp); 130 DCHECK(tp);
131 131
132 // TODO(flackr): Pass scale factor when fetching themeable images.
133 scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData( 132 scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData(
134 resource_id)); 133 resource_id, scale_factor));
135 SendResponse(request_id, image_data); 134 SendResponse(request_id, image_data);
136 } else { 135 } else {
137 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
138 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 137 const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
139 SendResponse(request_id, 138 SendResponse(request_id,
140 rb.LoadDataResourceBytes(resource_id, scale_factor)); 139 rb.LoadDataResourceBytes(resource_id, scale_factor));
141 } 140 }
142 } 141 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/download/background_theme.mm ('k') | ui/base/theme_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698