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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "ui/base/layout.h" | 10 #include "ui/base/layout.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 void ResourceBundle::LoadCommonResources() { | 37 void ResourceBundle::LoadCommonResources() { |
38 // Always load the 1x data pack first as the 2x data pack contains both 1x and | 38 // Always load the 1x data pack first as the 2x data pack contains both 1x and |
39 // 2x images. The 1x data pack only has 1x images, thus passes in an accurate | 39 // 2x images. The 1x data pack only has 1x images, thus passes in an accurate |
40 // scale factor to gfx::ImageSkia::AddRepresentation. | 40 // scale factor to gfx::ImageSkia::AddRepresentation. |
41 | 41 |
42 AddDataPackFromPath(GetResourcesPakFilePath("chrome.pak"), | 42 AddDataPackFromPath(GetResourcesPakFilePath("chrome.pak"), |
43 SCALE_FACTOR_100P); | 43 SCALE_FACTOR_100P); |
44 | 44 |
45 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { | 45 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { |
46 // 1x touch | 46 // 1x touch |
47 AddDataPackFromPath(GetResourcesPakFilePath("theme_resources_touch_1x.pak"), | 47 AddDataPackFromPath(GetResourcesPakFilePath( |
| 48 "theme_resources_touch_100_percent.pak"), |
48 SCALE_FACTOR_100P); | 49 SCALE_FACTOR_100P); |
49 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_touch.pak"), | 50 AddDataPackFromPath(GetResourcesPakFilePath( |
| 51 "ui_resources_touch_100_percent.pak"), |
50 SCALE_FACTOR_100P); | 52 SCALE_FACTOR_100P); |
51 if (ShouldLoad2xResources()) { | 53 if (ShouldLoad2xResources()) { |
52 // 2x touch | 54 // 2x touch |
53 AddDataPackFromPath( | 55 AddDataPackFromPath( |
54 GetResourcesPakFilePath("theme_resources_touch_2x.pak"), | 56 GetResourcesPakFilePath("theme_resources_touch_200_percent.pak"), |
55 SCALE_FACTOR_200P); | 57 SCALE_FACTOR_200P); |
56 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_touch_2x.pak"), | 58 AddDataPackFromPath(GetResourcesPakFilePath( |
| 59 "ui_resources_touch_200_percent.pak"), |
57 SCALE_FACTOR_200P); | 60 SCALE_FACTOR_200P); |
58 } | 61 } |
59 } else { | 62 } else { |
60 // 1x non touch | 63 // 1x non touch |
61 AddDataPackFromPath(GetResourcesPakFilePath("theme_resources_standard.pak"), | 64 AddDataPackFromPath(GetResourcesPakFilePath( |
| 65 "theme_resources_100_percent.pak"), |
62 SCALE_FACTOR_100P); | 66 SCALE_FACTOR_100P); |
63 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_standard.pak"), | 67 AddDataPackFromPath(GetResourcesPakFilePath( |
| 68 "ui_resources_100_percent.pak"), |
64 SCALE_FACTOR_100P); | 69 SCALE_FACTOR_100P); |
65 if (ShouldLoad2xResources()) { | 70 if (ShouldLoad2xResources()) { |
66 // 2x non touch | 71 // 2x non touch |
67 AddDataPackFromPath(GetResourcesPakFilePath("theme_resources_2x.pak"), | 72 AddDataPackFromPath(GetResourcesPakFilePath( |
| 73 "theme_resources_200_percent.pak"), |
68 SCALE_FACTOR_200P); | 74 SCALE_FACTOR_200P); |
69 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_2x.pak"), | 75 AddDataPackFromPath(GetResourcesPakFilePath( |
| 76 "ui_resources_200_percent.pak"), |
70 SCALE_FACTOR_200P); | 77 SCALE_FACTOR_200P); |
71 } | 78 } |
72 } | 79 } |
73 } | 80 } |
74 | 81 |
75 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { | 82 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { |
76 // Flipped image is not used on ChromeOS. | 83 // Flipped image is not used on ChromeOS. |
77 DCHECK_EQ(rtl, RTL_DISABLED); | 84 DCHECK_EQ(rtl, RTL_DISABLED); |
78 return GetImageNamed(resource_id); | 85 return GetImageNamed(resource_id); |
79 } | 86 } |
80 | 87 |
81 } // namespace ui | 88 } // namespace ui |
OLD | NEW |