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

Side by Side Diff: ui/base/resource/resource_bundle_mac.mm

Issue 10103022: Revert 132517 - Metro/HiDPI: Move 1x icons into separate pak file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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_linux.cc ('k') | ui/base/resource/resource_bundle_win.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 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 if (!resource_path) 38 if (!resource_path)
39 return FilePath(); 39 return FilePath();
40 return FilePath([resource_path fileSystemRepresentation]); 40 return FilePath([resource_path fileSystemRepresentation]);
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 void ResourceBundle::LoadCommonResources() { 45 void ResourceBundle::LoadCommonResources() {
46 AddDataPack(GetResourcesPakFilePath(@"chrome", nil)); 46 AddDataPack(GetResourcesPakFilePath(@"chrome", nil));
47 AddDataPack(GetResourcesPakFilePath(@"theme_resources_standard", nil)); 47 if (base::mac::IsOSLionOrLater())
48 AddDataPack(GetResourcesPakFilePath(@"ui_resources_standard", nil));
49
50 // On Windows and ChromeOS we load either the 1x resource or the 2x resource.
51 // On Mac we load both and let the UI framework decide which one to use.
52 #if defined(ENABLE_HIDPI)
53 if (base::mac::IsOSLionOrLater()) {
54 AddDataPack(GetResourcesPakFilePath(@"theme_resources_2x", nil)); 48 AddDataPack(GetResourcesPakFilePath(@"theme_resources_2x", nil));
55 AddDataPack(GetResourcesPakFilePath(@"theme_resources_standard_2x", nil));
56 AddDataPack(GetResourcesPakFilePath(@"ui_resources_standard_2x", nil));
57 }
58 #endif
59 } 49 }
60 50
61 // static 51 // static
62 FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) { 52 FilePath ResourceBundle::GetLocaleFilePath(const std::string& app_locale) {
63 NSString* mac_locale = base::SysUTF8ToNSString(app_locale); 53 NSString* mac_locale = base::SysUTF8ToNSString(app_locale);
64 54
65 // Mac OS X uses "_" instead of "-", so swap to get a Mac-style value. 55 // Mac OS X uses "_" instead of "-", so swap to get a Mac-style value.
66 mac_locale = [mac_locale stringByReplacingOccurrencesOfString:@"-" 56 mac_locale = [mac_locale stringByReplacingOccurrencesOfString:@"-"
67 withString:@"_"]; 57 withString:@"_"];
68 58
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 if (images_.count(resource_id)) { 113 if (images_.count(resource_id)) {
124 return *images_[resource_id]; 114 return *images_[resource_id];
125 } 115 }
126 116
127 gfx::Image* image = new gfx::Image(ns_image.release()); 117 gfx::Image* image = new gfx::Image(ns_image.release());
128 images_[resource_id] = image; 118 images_[resource_id] = image;
129 return *image; 119 return *image;
130 } 120 }
131 121
132 } // namespace ui 122 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_linux.cc ('k') | ui/base/resource/resource_bundle_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698