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_win.h" | 5 #include "ui/base/resource/resource_bundle_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "ui/base/layout.h" | 9 #include "ui/base/layout.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 bool use_hidpi = false; | 39 bool use_hidpi = false; |
40 #if defined(ENABLE_HIDPI) | 40 #if defined(ENABLE_HIDPI) |
41 // If we're running in HiDPI mode at a scale larger than 150%, we switch | 41 // If we're running in HiDPI mode at a scale larger than 150%, we switch |
42 // to 2x resources for desktop layouts. | 42 // to 2x resources for desktop layouts. |
43 use_hidpi = ui::GetDPIScale() > 1.5; | 43 use_hidpi = ui::GetDPIScale() > 1.5; |
44 #endif | 44 #endif |
45 | 45 |
46 switch (ui::GetDisplayLayout()) { | 46 switch (ui::GetDisplayLayout()) { |
47 case ui::LAYOUT_TOUCH: | 47 case ui::LAYOUT_TOUCH: |
48 AddDataPack(GetResourcesPakFilePath("theme_resources_metro_1x.pak")); | 48 AddDataPack(GetResourcesPakFilePath("theme_resources_touch_1x.pak")); |
49 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak")); | 49 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak")); |
50 break; | 50 break; |
51 default: | 51 default: |
52 if (use_hidpi) { | 52 if (use_hidpi) { |
53 AddDataPack(GetResourcesPakFilePath("theme_resources_2x.pak")); | 53 AddDataPack(GetResourcesPakFilePath("theme_resources_2x.pak")); |
54 AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak")); | 54 AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak")); |
55 } else { | 55 } else { |
56 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak")); | 56 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak")); |
57 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak")); | 57 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak")); |
58 } | 58 } |
(...skipping 12 matching lines...) Expand all Loading... |
71 | 71 |
72 void SetResourcesDataDLL(HINSTANCE handle) { | 72 void SetResourcesDataDLL(HINSTANCE handle) { |
73 resources_data_dll = handle; | 73 resources_data_dll = handle; |
74 } | 74 } |
75 | 75 |
76 HICON LoadThemeIconFromResourcesDataDLL(int icon_id) { | 76 HICON LoadThemeIconFromResourcesDataDLL(int icon_id) { |
77 return ::LoadIcon(GetCurrentResourceDLL(), MAKEINTRESOURCE(icon_id)); | 77 return ::LoadIcon(GetCurrentResourceDLL(), MAKEINTRESOURCE(icon_id)); |
78 } | 78 } |
79 | 79 |
80 } // namespace ui; | 80 } // namespace ui; |
OLD | NEW |