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 27 matching lines...) Expand all Loading... |
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( | 47 AddDataPackFromPath(GetResourcesPakFilePath( |
48 "theme_resources_touch_100_percent.pak"), | 48 "chrome_touch_100_percent.pak"), |
49 SCALE_FACTOR_100P); | |
50 AddDataPackFromPath(GetResourcesPakFilePath( | |
51 "ui_resources_touch_100_percent.pak"), | |
52 SCALE_FACTOR_100P); | 49 SCALE_FACTOR_100P); |
53 if (ShouldLoad2xResources()) { | 50 if (ShouldLoad2xResources()) { |
54 // 2x touch | 51 // 2x touch |
55 AddDataPackFromPath(GetResourcesPakFilePath( | 52 AddDataPackFromPath(GetResourcesPakFilePath( |
56 "theme_resources_touch_200_percent.pak"), | 53 "chrome_touch_200_percent.pak"), |
57 SCALE_FACTOR_200P); | |
58 AddDataPackFromPath(GetResourcesPakFilePath( | |
59 "ui_resources_touch_200_percent.pak"), | |
60 SCALE_FACTOR_200P); | |
61 AddDataPackFromPath(GetResourcesPakFilePath( | |
62 "webkit_resources_200_percent.pak"), | |
63 SCALE_FACTOR_200P); | 54 SCALE_FACTOR_200P); |
64 } | 55 } |
65 } else { | 56 } else { |
66 // 1x non touch | 57 // 1x non touch |
67 AddDataPackFromPath(GetResourcesPakFilePath( | 58 AddDataPackFromPath(GetResourcesPakFilePath( |
68 "theme_resources_100_percent.pak"), | 59 "chrome_100_percent.pak"), |
69 SCALE_FACTOR_100P); | |
70 AddDataPackFromPath(GetResourcesPakFilePath( | |
71 "ui_resources_100_percent.pak"), | |
72 SCALE_FACTOR_100P); | 60 SCALE_FACTOR_100P); |
73 if (ShouldLoad2xResources()) { | 61 if (ShouldLoad2xResources()) { |
74 // 2x non touch | 62 // 2x non touch |
75 AddDataPackFromPath(GetResourcesPakFilePath( | 63 AddDataPackFromPath(GetResourcesPakFilePath( |
76 "theme_resources_200_percent.pak"), | 64 "chrome_200_percent.pak"), |
77 SCALE_FACTOR_200P); | |
78 AddDataPackFromPath(GetResourcesPakFilePath( | |
79 "ui_resources_200_percent.pak"), | |
80 SCALE_FACTOR_200P); | |
81 AddDataPackFromPath(GetResourcesPakFilePath( | |
82 "webkit_resources_200_percent.pak"), | |
83 SCALE_FACTOR_200P); | 65 SCALE_FACTOR_200P); |
84 } | 66 } |
85 } | 67 } |
86 } | 68 } |
87 | 69 |
88 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { | 70 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { |
89 // Flipped image is not used on ChromeOS. | 71 // Flipped image is not used on ChromeOS. |
90 DCHECK_EQ(rtl, RTL_DISABLED); | 72 DCHECK_EQ(rtl, RTL_DISABLED); |
91 return GetImageNamed(resource_id); | 73 return GetImageNamed(resource_id); |
92 } | 74 } |
93 | 75 |
94 } // namespace ui | 76 } // namespace ui |
OLD | NEW |