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 "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "ui/base/layout.h" | 10 #include "ui/base/layout.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 void ResourceBundle::LoadCommonResources() { | 38 void ResourceBundle::LoadCommonResources() { |
39 // As a convenience, add the current resource module as a data packs. | 39 // As a convenience, add the current resource module as a data packs. |
40 data_packs_.push_back(new ResourceDataDLL(GetCurrentResourceDLL())); | 40 data_packs_.push_back(new ResourceDataDLL(GetCurrentResourceDLL())); |
41 // Have high-DPI resources for 140% and 180% scaling on Windows based on | 41 // Have high-DPI resources for 140% and 180% scaling on Windows based on |
42 // default scaling for Metro mode. If high-DPI mode is enabled, load resource | 42 // default scaling for Metro mode. If high-DPI mode is enabled, load resource |
43 // pak closest to the desired scale factor. The high-DPI resources are | 43 // pak closest to the desired scale factor. The high-DPI resources are |
44 // scaled up from 100% touch. | 44 // scaled up from 100% touch. |
45 float scale = gfx::win::GetDeviceScaleFactor(); | 45 float scale = gfx::win::GetDeviceScaleFactor(); |
46 bool force_touch_resources = false; | 46 bool force_touch_resources = false; |
47 switch(ui::GetScaleFactorFromScale(scale)) { | 47 switch(ui::GetSupportedScaleFactor(scale)) { |
48 case ui::SCALE_FACTOR_180P: | 48 case ui::SCALE_FACTOR_180P: |
49 AddDataPackFromPath(GetResourcesPakFilePath( | 49 AddDataPackFromPath(GetResourcesPakFilePath( |
50 "chrome_touch_180_percent.pak"), | 50 "chrome_touch_180_percent.pak"), |
51 SCALE_FACTOR_180P); | 51 SCALE_FACTOR_180P); |
52 force_touch_resources = true; | 52 force_touch_resources = true; |
53 break; | 53 break; |
54 case ui::SCALE_FACTOR_140P: | 54 case ui::SCALE_FACTOR_140P: |
55 AddDataPackFromPath(GetResourcesPakFilePath( | 55 AddDataPackFromPath(GetResourcesPakFilePath( |
56 "chrome_touch_140_percent.pak"), | 56 "chrome_touch_140_percent.pak"), |
57 SCALE_FACTOR_140P); | 57 SCALE_FACTOR_140P); |
(...skipping 23 matching lines...) Expand all Loading... |
81 | 81 |
82 void SetResourcesDataDLL(HINSTANCE handle) { | 82 void SetResourcesDataDLL(HINSTANCE handle) { |
83 resources_data_dll = handle; | 83 resources_data_dll = handle; |
84 } | 84 } |
85 | 85 |
86 HICON LoadThemeIconFromResourcesDataDLL(int icon_id) { | 86 HICON LoadThemeIconFromResourcesDataDLL(int icon_id) { |
87 return ::LoadIcon(GetCurrentResourceDLL(), MAKEINTRESOURCE(icon_id)); | 87 return ::LoadIcon(GetCurrentResourceDLL(), MAKEINTRESOURCE(icon_id)); |
88 } | 88 } |
89 | 89 |
90 } // namespace ui; | 90 } // namespace ui; |
OLD | NEW |