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

Side by Side Diff: app/resource_bundle.h

Issue 442002: Share code between Mac and Linux in ResourceBundle. (Closed)
Patch Set: sync Created 11 years 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
« no previous file with comments | « app/app.gyp ('k') | app/resource_bundle_linux.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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 APP_RESOURCE_BUNDLE_H_ 5 #ifndef APP_RESOURCE_BUNDLE_H_
6 #define APP_RESOURCE_BUNDLE_H_ 6 #define APP_RESOURCE_BUNDLE_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 typedef base::DataPack* DataHandle; 156 typedef base::DataPack* DataHandle;
157 #endif 157 #endif
158 158
159 // Ctor/dtor are private, since we're a singleton. 159 // Ctor/dtor are private, since we're a singleton.
160 ResourceBundle(); 160 ResourceBundle();
161 ~ResourceBundle(); 161 ~ResourceBundle();
162 162
163 // Free skia_images_. 163 // Free skia_images_.
164 void FreeImages(); 164 void FreeImages();
165 165
166 #if defined(USE_X11)
167 // Free gdkPixbufs_.
168 void FreeGdkPixBufs();
169 #endif
170
166 // Try to load the main resources and the locale specific strings from an 171 // Try to load the main resources and the locale specific strings from an
167 // external data module. 172 // external data module.
168 void LoadResources(const std::wstring& pref_locale); 173 void LoadResources(const std::wstring& pref_locale);
169 174
170 // Initialize all the gfx::Font members if they haven't yet been initialized. 175 // Initialize all the gfx::Font members if they haven't yet been initialized.
171 void LoadFontsIfNecessary(); 176 void LoadFontsIfNecessary();
172 177
178 #if defined(USE_BASE_DATA_PACK)
179 // Returns the full pathname of the main resources file to load. May return
180 // an empty string if no main resources data files are found.
181 static FilePath GetResourcesFilePath();
182 #endif
183
173 // Returns the full pathname of the locale file to load. May return an empty 184 // Returns the full pathname of the locale file to load. May return an empty
174 // string if no locale data files are found. 185 // string if no locale data files are found.
175 FilePath GetLocaleFilePath(const std::wstring& pref_locale); 186 static FilePath GetLocaleFilePath(const std::wstring& pref_locale);
176 187
177 // Returns a handle to bytes from the resource |module|, without doing any 188 // Returns a handle to bytes from the resource |module|, without doing any
178 // processing or interpretation of the resource. Returns whether we 189 // processing or interpretation of the resource. Returns whether we
179 // successfully read the resource. Caller does not own the data returned 190 // successfully read the resource. Caller does not own the data returned
180 // through this method and must not modify the data pointed to by |bytes|. 191 // through this method and must not modify the data pointed to by |bytes|.
181 static RefCountedStaticMemory* LoadResourceBytes(DataHandle module, 192 static RefCountedStaticMemory* LoadResourceBytes(DataHandle module,
182 int resource_id); 193 int resource_id);
183 194
184 // Creates and returns a new SkBitmap given the data file to look in and the 195 // Creates and returns a new SkBitmap given the data file to look in and the
185 // resource id. It's up to the caller to free the returned bitmap when 196 // resource id. It's up to the caller to free the returned bitmap when
(...skipping 24 matching lines...) Expand all
210 scoped_ptr<gfx::Font> medium_bold_font_; 221 scoped_ptr<gfx::Font> medium_bold_font_;
211 scoped_ptr<gfx::Font> large_font_; 222 scoped_ptr<gfx::Font> large_font_;
212 scoped_ptr<gfx::Font> web_font_; 223 scoped_ptr<gfx::Font> web_font_;
213 224
214 static ResourceBundle* g_shared_instance_; 225 static ResourceBundle* g_shared_instance_;
215 226
216 DISALLOW_EVIL_CONSTRUCTORS(ResourceBundle); 227 DISALLOW_EVIL_CONSTRUCTORS(ResourceBundle);
217 }; 228 };
218 229
219 #endif // APP_RESOURCE_BUNDLE_H_ 230 #endif // APP_RESOURCE_BUNDLE_H_
OLDNEW
« no previous file with comments | « app/app.gyp ('k') | app/resource_bundle_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698