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

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

Issue 10412004: Revert "Revert 137734 - Select theme resources from ResourceBundle at requested scale factor." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master Created 8 years, 7 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 | Annotate | Revision Log
« 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/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
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
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