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

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

Issue 52713010: Remove reference to missing assets. 140 and 180 have been removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 1 month 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); 555 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
556 if (display.device_scale_factor() > 1.0) { 556 if (display.device_scale_factor() > 1.0) {
557 DCHECK_EQ(2.0, display.device_scale_factor()); 557 DCHECK_EQ(2.0, display.device_scale_factor());
558 supported_scale_factors.push_back(SCALE_FACTOR_200P); 558 supported_scale_factors.push_back(SCALE_FACTOR_200P);
559 } else { 559 } else {
560 supported_scale_factors.push_back(SCALE_FACTOR_100P); 560 supported_scale_factors.push_back(SCALE_FACTOR_100P);
561 } 561 }
562 #elif defined(OS_MACOSX) 562 #elif defined(OS_MACOSX)
563 if (base::mac::IsOSLionOrLater()) 563 if (base::mac::IsOSLionOrLater())
564 supported_scale_factors.push_back(SCALE_FACTOR_200P); 564 supported_scale_factors.push_back(SCALE_FACTOR_200P);
565 #elif defined(OS_WIN)
566 // Have high-DPI resources for 140% and 180% scaling on Windows based on
567 // default scaling for Metro mode. Round to nearest supported scale in
568 // all cases.
569 if (gfx::IsInHighDPIMode()) {
570 supported_scale_factors.push_back(SCALE_FACTOR_140P);
571 supported_scale_factors.push_back(SCALE_FACTOR_180P);
572 }
573 #elif defined(OS_CHROMEOS) 565 #elif defined(OS_CHROMEOS)
574 // TODO(oshima): Include 200P only if the device support 200P 566 // TODO(oshima): Include 200P only if the device support 200P
575 supported_scale_factors.push_back(SCALE_FACTOR_200P); 567 supported_scale_factors.push_back(SCALE_FACTOR_200P);
576 #endif 568 #endif
577 ui::SetSupportedScaleFactors(supported_scale_factors); 569 ui::SetSupportedScaleFactors(supported_scale_factors);
578 #if defined(OS_WIN) 570 #if defined(OS_WIN)
579 // Must be called _after_ supported scale factors are set since it 571 // Must be called _after_ supported scale factors are set since it
580 // uses them. 572 // uses them.
581 ui::win::InitDeviceScaleFactor(); 573 ui::win::InitDeviceScaleFactor();
582 #endif 574 #endif
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 // static 796 // static
805 bool ResourceBundle::DecodePNG(const unsigned char* buf, 797 bool ResourceBundle::DecodePNG(const unsigned char* buf,
806 size_t size, 798 size_t size,
807 SkBitmap* bitmap, 799 SkBitmap* bitmap,
808 bool* fell_back_to_1x) { 800 bool* fell_back_to_1x) {
809 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); 801 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size);
810 return gfx::PNGCodec::Decode(buf, size, bitmap); 802 return gfx::PNGCodec::Decode(buf, size, bitmap);
811 } 803 }
812 804
813 } // namespace ui 805 } // 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