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

Side by Side Diff: ui/base/resource/resource_bundle.h

Issue 10387010: Select theme resources from ResourceBundle at requested scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 5 #ifndef UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 6 #define UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 gfx::Image& GetNativeImageNamed(int resource_id, ImageRTL rtl); 123 gfx::Image& GetNativeImageNamed(int resource_id, ImageRTL rtl);
124 124
125 // Same as GetNativeImageNamed() except that RTL is not enabled. 125 // Same as GetNativeImageNamed() except that RTL is not enabled.
126 gfx::Image& GetNativeImageNamed(int resource_id); 126 gfx::Image& GetNativeImageNamed(int resource_id);
127 127
128 // Loads the raw bytes of a data resource into |bytes|, 128 // Loads the raw bytes of a data resource into |bytes|,
129 // without doing any processing or interpretation of 129 // without doing any processing or interpretation of
130 // the resource. Returns whether we successfully read the resource. 130 // the resource. Returns whether we successfully read the resource.
131 base::RefCountedStaticMemory* LoadDataResourceBytes(int resource_id) const; 131 base::RefCountedStaticMemory* LoadDataResourceBytes(int resource_id) const;
132 132
133 // Loads and returns the raw bytes of an image data resource nearest the
134 // target scale factor without doing any processing or interpretation of the
135 // resource. Returns a RefCountedStaticMemory pointer to the image bytes on
136 // success or NULL on failure to locate the resource.
137 base::RefCountedStaticMemory* LoadImageResourceBytes(
sail 2012/05/09 16:09:41 Instead of adding additional APIs we should just a
flackr 2012/05/09 19:57:01 We could do this but the scale factor doesn't make
sail 2012/05/09 20:08:19 For for loading images we'll now have two APIs, on
flackr 2012/05/09 20:15:42 I assume you were tongue twisted and meant to say
flackr 2012/05/09 20:16:53 Alternately as a low road approach we could assert
138 int resource_id,
139 float scale_factor) const;
140
141 // Returns the contents of an image resource in a StringPiece nearest the
142 // scale factor |scale_factor| given the resource id.
143 base::StringPiece GetRawImageResource(int resource_id,
sail 2012/05/09 16:09:41 same
144 float scale_factor) const;
145
133 // Return the contents of a resource in a StringPiece given the resource id. 146 // Return the contents of a resource in a StringPiece given the resource id.
134 base::StringPiece GetRawDataResource(int resource_id) const; 147 base::StringPiece GetRawDataResource(int resource_id) const;
135 148
136 // Get a localized string given a message id. Returns an empty 149 // Get a localized string given a message id. Returns an empty
137 // string if the message_id is not found. 150 // string if the message_id is not found.
138 string16 GetLocalizedString(int message_id); 151 string16 GetLocalizedString(int message_id);
139 152
140 // Returns the font for the specified style. 153 // Returns the font for the specified style.
141 const gfx::Font& GetFont(FontStyle style); 154 const gfx::Font& GetFont(FontStyle style);
142 155
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 234
222 DISALLOW_COPY_AND_ASSIGN(ResourceBundle); 235 DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
223 }; 236 };
224 237
225 } // namespace ui 238 } // namespace ui
226 239
227 // TODO(beng): Someday, maybe, get rid of this. 240 // TODO(beng): Someday, maybe, get rid of this.
228 using ui::ResourceBundle; 241 using ui::ResourceBundle;
229 242
230 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_ 243 #endif // UI_BASE_RESOURCE_RESOURCE_BUNDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698