Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: ui/base/resource/resource_bundle_aurax11.cc

Issue 10686005: Add methods to add DataPack from open files (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/resource/resource_bundle_android.cc ('k') | ui/base/resource/resource_bundle_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 32
33 } // namespace 33 } // namespace
34 34
35 namespace ui { 35 namespace ui {
36 36
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 AddDataPack(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 AddDataPack(GetResourcesPakFilePath("theme_resources_touch_1x.pak"), 47 AddDataPackFromPath(GetResourcesPakFilePath("theme_resources_touch_1x.pak"),
48 SCALE_FACTOR_100P); 48 SCALE_FACTOR_100P);
49 AddDataPack(GetResourcesPakFilePath("ui_resources_touch.pak"), 49 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_touch.pak"),
50 SCALE_FACTOR_100P); 50 SCALE_FACTOR_100P);
51 if (ShouldLoad2xResources()) { 51 if (ShouldLoad2xResources()) {
52 // 2x touch 52 // 2x touch
53 AddDataPack(GetResourcesPakFilePath("theme_resources_touch_2x.pak"), 53 AddDataPackFromPath(
54 SCALE_FACTOR_200P); 54 GetResourcesPakFilePath("theme_resources_touch_2x.pak"),
55 AddDataPack(GetResourcesPakFilePath("ui_resources_touch_2x.pak"), 55 SCALE_FACTOR_200P);
56 SCALE_FACTOR_200P); 56 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_touch_2x.pak"),
57 SCALE_FACTOR_200P);
57 } 58 }
58 } else { 59 } else {
59 // 1x non touch 60 // 1x non touch
60 AddDataPack(GetResourcesPakFilePath("theme_resources_standard.pak"), 61 AddDataPackFromPath(GetResourcesPakFilePath("theme_resources_standard.pak"),
61 SCALE_FACTOR_100P); 62 SCALE_FACTOR_100P);
62 AddDataPack(GetResourcesPakFilePath("ui_resources_standard.pak"), 63 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_standard.pak"),
63 SCALE_FACTOR_100P); 64 SCALE_FACTOR_100P);
64 if (ShouldLoad2xResources()) { 65 if (ShouldLoad2xResources()) {
65 // 2x non touch 66 // 2x non touch
66 AddDataPack(GetResourcesPakFilePath("theme_resources_2x.pak"), 67 AddDataPackFromPath(GetResourcesPakFilePath("theme_resources_2x.pak"),
67 SCALE_FACTOR_200P); 68 SCALE_FACTOR_200P);
68 AddDataPack(GetResourcesPakFilePath("ui_resources_2x.pak"), 69 AddDataPackFromPath(GetResourcesPakFilePath("ui_resources_2x.pak"),
69 SCALE_FACTOR_200P); 70 SCALE_FACTOR_200P);
70 } 71 }
71 } 72 }
72 } 73 }
73 74
74 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { 75 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
75 // Flipped image is not used on ChromeOS. 76 // Flipped image is not used on ChromeOS.
76 DCHECK_EQ(rtl, RTL_DISABLED); 77 DCHECK_EQ(rtl, RTL_DISABLED);
77 return GetImageNamed(resource_id); 78 return GetImageNamed(resource_id);
78 } 79 }
79 80
80 } // namespace ui 81 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_android.cc ('k') | ui/base/resource/resource_bundle_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698