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

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

Issue 402603006: [android_webview] Do not extract webviewchromium.pak (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@awassets
Patch Set: Fix pakfile source path Created 6 years, 5 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
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 "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const std::string& pref_locale, Delegate* delegate) { 169 const std::string& pref_locale, Delegate* delegate) {
170 InitSharedInstance(delegate); 170 InitSharedInstance(delegate);
171 std::string result = g_shared_instance_->LoadLocaleResources(pref_locale); 171 std::string result = g_shared_instance_->LoadLocaleResources(pref_locale);
172 InitDefaultFontList(); 172 InitDefaultFontList();
173 return result; 173 return result;
174 } 174 }
175 175
176 // static 176 // static
177 void ResourceBundle::InitSharedInstanceWithPakFile( 177 void ResourceBundle::InitSharedInstanceWithPakFile(
178 base::File pak_file, bool should_load_common_resources) { 178 base::File pak_file, bool should_load_common_resources) {
179 InitSharedInstanceWithPakFileRegion(pak_file.Pass(),
180 base::File::Region::WholeFile(),
181 should_load_common_resources);
182 }
183
184 // static
185 void ResourceBundle::InitSharedInstanceWithPakFileRegion(
186 base::File pak_file,
187 const base::File::Region& region,
188 bool should_load_common_resources) {
179 InitSharedInstance(NULL); 189 InitSharedInstance(NULL);
180 if (should_load_common_resources) 190 if (should_load_common_resources)
181 g_shared_instance_->LoadCommonResources(); 191 g_shared_instance_->LoadCommonResources();
182 192
183 scoped_ptr<DataPack> data_pack( 193 scoped_ptr<DataPack> data_pack(
184 new DataPack(SCALE_FACTOR_100P)); 194 new DataPack(SCALE_FACTOR_100P));
185 if (!data_pack->LoadFromFile(pak_file.Pass())) { 195 if (!data_pack->LoadFromFileRegion(pak_file.Pass(), region)) {
186 NOTREACHED() << "failed to load pak file"; 196 NOTREACHED() << "failed to load pak file";
187 return; 197 return;
188 } 198 }
189 g_shared_instance_->locale_resources_data_.reset(data_pack.release()); 199 g_shared_instance_->locale_resources_data_.reset(data_pack.release());
190 InitDefaultFontList(); 200 InitDefaultFontList();
191 } 201 }
192 202
193 // static 203 // static
194 void ResourceBundle::InitSharedInstanceWithPakPath(const base::FilePath& path) { 204 void ResourceBundle::InitSharedInstanceWithPakPath(const base::FilePath& path) {
195 InitSharedInstance(NULL); 205 InitSharedInstance(NULL);
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 // static 850 // static
841 bool ResourceBundle::DecodePNG(const unsigned char* buf, 851 bool ResourceBundle::DecodePNG(const unsigned char* buf,
842 size_t size, 852 size_t size,
843 SkBitmap* bitmap, 853 SkBitmap* bitmap,
844 bool* fell_back_to_1x) { 854 bool* fell_back_to_1x) {
845 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 855 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
846 return gfx::PNGCodec::Decode(buf, size, bitmap); 856 return gfx::PNGCodec::Decode(buf, size, bitmap);
847 } 857 }
848 858
849 } // namespace ui 859 } // namespace ui
OLDNEW
« ui/base/resource/resource_bundle.h ('K') | « ui/base/resource/resource_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698