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

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

Issue 22339020: Remove chrome.pak references, build resources into resources.pak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove chrome.pak references so 'all' builds Created 7 years, 4 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_auralinux.cc ('k') | ui/base/resource/resource_bundle_mac.mm » ('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/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (PathService::Get(base::DIR_MODULE, &path)) 58 if (PathService::Get(base::DIR_MODULE, &path))
59 return path.AppendASCII(pak_name.c_str()); 59 return path.AppendASCII(pak_name.c_str());
60 60
61 // Return just the name of the pack file. 61 // Return just the name of the pack file.
62 return base::FilePath(pak_name.c_str()); 62 return base::FilePath(pak_name.c_str());
63 } 63 }
64 64
65 } // namespace 65 } // namespace
66 66
67 void ResourceBundle::LoadCommonResources() { 67 void ResourceBundle::LoadCommonResources() {
68 AddDataPackFromPath(GetResourcesPakFilePath("chrome.pak"),
69 SCALE_FACTOR_NONE);
70 AddDataPackFromPath(GetResourcesPakFilePath( 68 AddDataPackFromPath(GetResourcesPakFilePath(
71 "chrome_100_percent.pak"), 69 "chrome_100_percent.pak"),
72 SCALE_FACTOR_100P); 70 SCALE_FACTOR_100P);
73 } 71 }
74 72
75 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) { 73 gfx::Image& ResourceBundle::GetNativeImageNamed(int resource_id, ImageRTL rtl) {
76 // Use the negative |resource_id| for the key for BIDI-aware images. 74 // Use the negative |resource_id| for the key for BIDI-aware images.
77 int key = rtl == RTL_ENABLED ? -resource_id : resource_id; 75 int key = rtl == RTL_ENABLED ? -resource_id : resource_id;
78 76
79 // Check to see if the image is already in the cache. 77 // Check to see if the image is already in the cache.
(...skipping 25 matching lines...) Expand all
105 103
106 // Another thread raced the load and has already cached the image. 104 // Another thread raced the load and has already cached the image.
107 if (images_.count(key)) 105 if (images_.count(key))
108 return images_[key]; 106 return images_[key];
109 107
110 images_[key] = image; 108 images_[key] = image;
111 return images_[key]; 109 return images_[key];
112 } 110 }
113 111
114 } // namespace ui 112 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_auralinux.cc ('k') | ui/base/resource/resource_bundle_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698