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

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

Issue 22418003: CHR-458: Remove DCHECK which prevents from using custom ResourceBundle::Delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A fixup based on review comments. Created 7 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
« no previous file with comments | « no previous file | no next file » | 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 "ui/base/resource/resource_bundle.h" 5 #include "ui/base/resource/resource_bundle.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 base::AutoLock lock_scope(*images_and_fonts_lock_); 314 base::AutoLock lock_scope(*images_and_fonts_lock_);
315 if (images_.count(resource_id)) 315 if (images_.count(resource_id))
316 return images_[resource_id]; 316 return images_[resource_id];
317 } 317 }
318 318
319 gfx::Image image; 319 gfx::Image image;
320 if (delegate_) 320 if (delegate_)
321 image = delegate_->GetImageNamed(resource_id); 321 image = delegate_->GetImageNamed(resource_id);
322 322
323 if (image.IsEmpty()) { 323 if (image.IsEmpty()) {
324 DCHECK(!delegate_ && !data_packs_.empty()) << 324 DCHECK(!data_packs_.empty()) <<
325 "Missing call to SetResourcesDataDLL?"; 325 "Missing call to SetResourcesDataDLL?";
326 326
327 // TODO(oshima): Consider reading the image size from png IHDR chunk and 327 // TODO(oshima): Consider reading the image size from png IHDR chunk and
328 // skip decoding here and remove #ifdef below. 328 // skip decoding here and remove #ifdef below.
329 // ResourceBundle::GetSharedInstance() is destroyed after the 329 // ResourceBundle::GetSharedInstance() is destroyed after the
330 // BrowserMainLoop has finished running. |image_skia| is guaranteed to be 330 // BrowserMainLoop has finished running. |image_skia| is guaranteed to be
331 // destroyed before the resource bundle is destroyed. 331 // destroyed before the resource bundle is destroyed.
332 #if defined(OS_CHROMEOS) 332 #if defined(OS_CHROMEOS)
333 ui::ScaleFactor scale_factor_to_load = ui::GetMaxScaleFactor(); 333 ui::ScaleFactor scale_factor_to_load = ui::GetMaxScaleFactor();
334 #else 334 #else
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 // static 727 // static
728 bool ResourceBundle::DecodePNG(const unsigned char* buf, 728 bool ResourceBundle::DecodePNG(const unsigned char* buf,
729 size_t size, 729 size_t size,
730 SkBitmap* bitmap, 730 SkBitmap* bitmap,
731 bool* fell_back_to_1x) { 731 bool* fell_back_to_1x) {
732 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 732 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
733 return gfx::PNGCodec::Decode(buf, size, bitmap); 733 return gfx::PNGCodec::Decode(buf, size, bitmap);
734 } 734 }
735 735
736 } // namespace ui 736 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698