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

Unified Diff: ui/base/resource/data_pack.cc

Issue 10387010: Select theme resources from ResourceBundle at requested scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Convert ptr to bool for win compile. 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/resource/data_pack.cc
diff --git a/ui/base/resource/data_pack.cc b/ui/base/resource/data_pack.cc
index 0fa97a83bd03104425edc2ae2d96b2647cabc2f7..81f87e9e6a1a2dfa05f17817d90564c0af00adca 100644
--- a/ui/base/resource/data_pack.cc
+++ b/ui/base/resource/data_pack.cc
@@ -145,6 +145,11 @@ bool DataPack::Load(const FilePath& path) {
return true;
}
+bool DataPack::HasResource(uint16 resource_id) const {
+ return !!bsearch(&resource_id, mmap_->data() + kHeaderLength, resource_count_,
tony 2012/05/11 21:22:03 Nit: The !! isn't necessary unless you think it im
flackr 2012/05/11 21:59:07 The win_rel try bot complained about casting void*
+ sizeof(DataPackEntry), DataPackEntry::CompareById);
+}
+
bool DataPack::GetStringPiece(uint16 resource_id,
base::StringPiece* data) const {
// It won't be hard to make this endian-agnostic, but it's not worth

Powered by Google App Engine
This is Rietveld 408576698