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

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

Issue 7055010: Rename internal gfx::Image members to be less confusing with Cocoa types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac Created 9 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 | « no previous file | ui/gfx/image.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 return GetResourcesPakFilePath(@"locale", mac_locale); 65 return GetResourcesPakFilePath(@"locale", mac_locale);
66 } 66 }
67 67
68 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) { 68 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id) {
69 // Check to see if the image is already in the cache. 69 // Check to see if the image is already in the cache.
70 { 70 {
71 base::AutoLock lock(*lock_); 71 base::AutoLock lock(*lock_);
72 ImageMap::const_iterator found = images_.find(resource_id); 72 ImageMap::const_iterator found = images_.find(resource_id);
73 if (found != images_.end()) { 73 if (found != images_.end()) {
74 if (!found->second->HasRepresentation(gfx::Image::kNSImageRep)) { 74 if (!found->second->HasRepresentation(gfx::Image::kImageRepCocoa)) {
75 DLOG(WARNING) << "ResourceBundle::GetNativeImageNamed() is returning a" 75 DLOG(WARNING) << "ResourceBundle::GetNativeImageNamed() is returning a"
76 << " cached gfx::Image that isn't backed by an NSImage. The image" 76 << " cached gfx::Image that isn't backed by an NSImage. The image"
77 << " will be converted, rather than going through the NSImage loader." 77 << " will be converted, rather than going through the NSImage loader."
78 << " resource_id = " << resource_id; 78 << " resource_id = " << resource_id;
79 } 79 }
80 return *found->second; 80 return *found->second;
81 } 81 }
82 } 82 }
83 83
84 // Load the raw data from the resource pack. 84 // Load the raw data from the resource pack.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 images_[resource_id] = image; 120 images_[resource_id] = image;
121 return *image; 121 return *image;
122 } 122 }
123 123
124 LOG(WARNING) << "Unable to load image with id " << resource_id; 124 LOG(WARNING) << "Unable to load image with id " << resource_id;
125 NOTREACHED(); // Want to assert in debug mode. 125 NOTREACHED(); // Want to assert in debug mode.
126 return *GetEmptyImage(); 126 return *GetEmptyImage();
127 } 127 }
128 128
129 } // namespace ui 129 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698