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

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

Issue 10115029: Set toolbar padding to something appropriate for Metro icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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/resource_bundle_win.cc
diff --git a/ui/base/resource/resource_bundle_win.cc b/ui/base/resource/resource_bundle_win.cc
index 38c7c0657e2df1dfef7c1bcac4c1193bd4deb823..107ad9d15ea797cf92f7b2550a73c20974583355 100644
--- a/ui/base/resource/resource_bundle_win.cc
+++ b/ui/base/resource/resource_bundle_win.cc
@@ -8,7 +8,7 @@
#include "base/path_service.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/resource/resource_data_dll_win.h"
-#include "ui/base/win/dpi.h"
+#include "ui/base/scale.h"
namespace ui {
@@ -43,30 +43,28 @@ void ResourceBundle::LoadCommonResources() {
// As a convenience, add the current resource module as a data packs.
data_packs_.push_back(new ResourceDataDLL(GetCurrentResourceDLL()));
- bool use_hidpi_pak = false;
-#if defined(ENABLE_HIDPI)
- // If we're running in HiDPI mode then use the 2x resource for DPI greater
- // than 1.5. Otherwise use the 1x resource.
- use_hidpi_pak = ui::GetDPIScale() > 1.5;
-#endif
-
- bool use_metro_pak = false;
-#if defined(ENABLE_METRO)
- use_metro_pak = IsInMetroMode();
-#endif
-
- if (use_metro_pak) {
- AddDataPack(GetResourcesPakFilePath("theme_resources_metro_1x.pak"));
- } else if (use_hidpi_pak) {
- AddDataPack(GetResourcesPakFilePath("theme_resources_2x.pak"));
- } else {
- AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"));
+ switch (ui::GetThemeScale()) {
+ case ui::DS_METRO_100:
+ case ui::DS_METRO_140:
+ case ui::DS_METRO_180:
+ // TODO(joi): Other Metro scales.
+ AddDataPack(GetResourcesPakFilePath("theme_resources_metro_1x.pak"));
+ break;
+ case ui::DS_DESKTOP_200:
+ AddDataPack(GetResourcesPakFilePath("theme_resources_2x.pak"));
+ break;
+ default:
+ AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"));
+ break;
}
- if (use_hidpi_pak) {
- AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak"));
- } else {
- AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"));
+ switch (ui::GetUIScale()) {
+ case ui::DS_DESKTOP_200:
+ AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak"));
+ break;
+ default:
+ AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"));
+ break;
}
}
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | ui/base/scale.h » ('j') | ui/base/scale.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698