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.h" | 5 #include "ui/base/resource/resource_bundle.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_handle.h" | 10 #include "ui/base/resource/resource_handle.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 void ResourceBundle::LoadCommonResources() { | 29 void ResourceBundle::LoadCommonResources() { |
30 // Always load the 1x data pack first as the 2x data pack contains both 1x and | 30 // Always load the 1x data pack first as the 2x data pack contains both 1x and |
31 // 2x images. The 1x data pack only has 1x images, thus passes in an accurate | 31 // 2x images. The 1x data pack only has 1x images, thus passes in an accurate |
32 // scale factor to gfx::ImageSkia::AddBitmapForScale. | 32 // scale factor to gfx::ImageSkia::AddBitmapForScale. |
33 // TODO(pkotwicz): Fix this in cases where it is intended for the 2x bitmap | 33 // TODO(pkotwicz): Fix this in cases where it is intended for the 2x bitmap |
34 // not to be 2 * size of the 1x bitmap for HDA. | 34 // not to be 2 * size of the 1x bitmap for HDA. |
35 // TODO(oshima): Fix this where it is unintended. | 35 // TODO(oshima): Fix this where it is unintended. |
36 | 36 |
37 AddDataPack(GetResourcesPakFilePath("chrome.pak"), | 37 AddDataPack(GetResourcesPakFilePath("chrome.pak"), |
38 ResourceHandle::kScaleFactor100x); | 38 SCALE_FACTOR_100P); |
39 | 39 |
40 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { | 40 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { |
41 AddDataPack(GetResourcesPakFilePath("theme_resources_touch_1x.pak"), | 41 AddDataPack(GetResourcesPakFilePath("theme_resources_touch_1x.pak"), |
42 ResourceHandle::kScaleFactor100x); | 42 SCALE_FACTOR_100P); |
43 AddDataPack(GetResourcesPakFilePath("ui_resources_touch.pak"), | 43 AddDataPack(GetResourcesPakFilePath("ui_resources_touch.pak"), |
44 ResourceHandle::kScaleFactor100x); | 44 SCALE_FACTOR_100P); |
45 } else { | 45 } else { |
46 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"), | 46 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"), |
47 ResourceHandle::kScaleFactor100x); | 47 SCALE_FACTOR_100P); |
48 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"), | 48 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"), |
49 ResourceHandle::kScaleFactor100x); | 49 SCALE_FACTOR_100P); |
50 AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak"), | 50 AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak"), |
51 ResourceHandle::kScaleFactor200x); | 51 SCALE_FACTOR_200P); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { | 55 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { |
56 // Flipped image is not used on ChromeOS. | 56 // Flipped image is not used on ChromeOS. |
57 DCHECK_EQ(rtl, RTL_DISABLED); | 57 DCHECK_EQ(rtl, RTL_DISABLED); |
58 return GetImageNamed(resource_id); | 58 return GetImageNamed(resource_id); |
59 } | 59 } |
60 | 60 |
61 } // namespace ui | 61 } // namespace ui |
OLD | NEW |