diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 19:10:25 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 19:10:25 +0000 |
commit | fff2da8cdac2dcc738cb21036f3c0a9f52dfa8f1 (patch) | |
tree | 33a971a538cd252bb8e2ff870e4354b4cb2bb984 /ui | |
parent | 72211e84e3be6423f95d57abfbd4c240e4635c7a (diff) | |
download | chromium_src-fff2da8cdac2dcc738cb21036f3c0a9f52dfa8f1.zip chromium_src-fff2da8cdac2dcc738cb21036f3c0a9f52dfa8f1.tar.gz chromium_src-fff2da8cdac2dcc738cb21036f3c0a9f52dfa8f1.tar.bz2 |
Load 2x resources whenever --default-device-scale-factor=2 is set
Bug=None
Test=Manual
Review URL: https://chromiumcodereview.appspot.com/10532127
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/resource/resource_bundle_aurax11.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/base/resource/resource_bundle_aurax11.cc b/ui/base/resource/resource_bundle_aurax11.cc index 378d521..95aad1e 100644 --- a/ui/base/resource/resource_bundle_aurax11.cc +++ b/ui/base/resource/resource_bundle_aurax11.cc @@ -11,6 +11,7 @@ #include "ui/base/resource/resource_handle.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" +#include "ui/gfx/display.h" #include "ui/gfx/image/image.h" namespace { @@ -24,6 +25,11 @@ FilePath GetResourcesPakFilePath(const std::string& pak_name) { return FilePath(pak_name.c_str()); } +bool ShouldLoad2xResources() { + return (gfx::Display::GetDefaultDeviceScaleFactor() > 1.0f || + CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoad2xResources)); +} + } // namespace namespace ui { @@ -45,8 +51,7 @@ void ResourceBundle::LoadCommonResources() { SCALE_FACTOR_100P); AddDataPack(GetResourcesPakFilePath("ui_resources_touch.pak"), SCALE_FACTOR_100P); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kLoad2xResources)) { + if (ShouldLoad2xResources()) { // 2x touch AddDataPack(GetResourcesPakFilePath("theme_resources_touch_2x.pak"), SCALE_FACTOR_200P); @@ -59,8 +64,7 @@ void ResourceBundle::LoadCommonResources() { SCALE_FACTOR_100P); AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"), SCALE_FACTOR_100P); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kLoad2xResources)) { + if (ShouldLoad2xResources()) { // 2x non touch AddDataPack(GetResourcesPakFilePath("theme_resources_standard_2x.pak"), SCALE_FACTOR_200P); |