OLD | NEW |
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 if (scale_factor != ui::SCALE_FACTOR_100P) { | 462 if (scale_factor != ui::SCALE_FACTOR_100P) { |
463 for (size_t i = 0; i < data_packs_.size(); i++) { | 463 for (size_t i = 0; i < data_packs_.size(); i++) { |
464 if (data_packs_[i]->GetScaleFactor() == scale_factor && | 464 if (data_packs_[i]->GetScaleFactor() == scale_factor && |
465 data_packs_[i]->GetStringPiece(resource_id, &data)) | 465 data_packs_[i]->GetStringPiece(resource_id, &data)) |
466 return data; | 466 return data; |
467 } | 467 } |
468 } | 468 } |
469 for (size_t i = 0; i < data_packs_.size(); i++) { | 469 for (size_t i = 0; i < data_packs_.size(); i++) { |
470 if ((data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_100P || | 470 if ((data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_100P || |
471 data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_200P || | 471 data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_200P || |
| 472 data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_300P || |
472 data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_NONE) && | 473 data_packs_[i]->GetScaleFactor() == ui::SCALE_FACTOR_NONE) && |
473 data_packs_[i]->GetStringPiece(resource_id, &data)) | 474 data_packs_[i]->GetStringPiece(resource_id, &data)) |
474 return data; | 475 return data; |
475 } | 476 } |
476 | 477 |
477 return base::StringPiece(); | 478 return base::StringPiece(); |
478 } | 479 } |
479 | 480 |
480 base::string16 ResourceBundle::GetLocalizedString(int message_id) { | 481 base::string16 ResourceBundle::GetLocalizedString(int message_id) { |
481 base::string16 string; | 482 base::string16 string; |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 // static | 857 // static |
857 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 858 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
858 size_t size, | 859 size_t size, |
859 SkBitmap* bitmap, | 860 SkBitmap* bitmap, |
860 bool* fell_back_to_1x) { | 861 bool* fell_back_to_1x) { |
861 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 862 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
862 return gfx::PNGCodec::Decode(buf, size, bitmap); | 863 return gfx::PNGCodec::Decode(buf, size, bitmap); |
863 } | 864 } |
864 | 865 |
865 } // namespace ui | 866 } // namespace ui |
OLD | NEW |