OLD | NEW |
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 return gdk_pixbuf_flip(pixbuf, TRUE); | 46 return gdk_pixbuf_flip(pixbuf, TRUE); |
47 } else { | 47 } else { |
48 // The pixbuf is owned by the loader, so add a ref so when we delete the | 48 // The pixbuf is owned by the loader, so add a ref so when we delete the |
49 // loader (when the ScopedGObject goes out of scope), the pixbuf still | 49 // loader (when the ScopedGObject goes out of scope), the pixbuf still |
50 // exists. | 50 // exists. |
51 g_object_ref(pixbuf); | 51 g_object_ref(pixbuf); |
52 return pixbuf; | 52 return pixbuf; |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 FilePath GetResourcesPakFilePath(const std::string& pak_name) { | 56 base::FilePath GetResourcesPakFilePath(const std::string& pak_name) { |
57 base::FilePath path; | 57 base::FilePath path; |
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 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 // Another thread raced the load and has already cached the image. | 106 // Another thread raced the load and has already cached the image. |
107 if (images_.count(key)) | 107 if (images_.count(key)) |
108 return images_[key]; | 108 return images_[key]; |
109 | 109 |
110 images_[key] = image; | 110 images_[key] = image; |
111 return images_[key]; | 111 return images_[key]; |
112 } | 112 } |
113 | 113 |
114 } // namespace ui | 114 } // namespace ui |
OLD | NEW |