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 "base/nix/mime_util_xdg.h" | 5 #include "base/nix/mime_util_xdg.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 | 153 |
154 // Set directories to search for icons to the comma-separated list |dirs|. | 154 // Set directories to search for icons to the comma-separated list |dirs|. |
155 bool SetDirectories(const std::string& dirs); | 155 bool SetDirectories(const std::string& dirs); |
156 | 156 |
157 bool index_theme_loaded_; // True if an instance is properly loaded. | 157 bool index_theme_loaded_; // True if an instance is properly loaded. |
158 // store the scattered directories of this theme. | 158 // store the scattered directories of this theme. |
159 std::list<FilePath> dirs_; | 159 std::list<FilePath> dirs_; |
160 | 160 |
161 // store the subdirs of this theme and array index of |info_array_|. | 161 // store the subdirs of this theme and array index of |info_array_|. |
162 std::map<std::string, int> subdirs_; | 162 std::map<std::string, int> subdirs_; |
163 scoped_array<SubDirInfo> info_array_; // List of sub-directories. | 163 scoped_ptr<SubDirInfo[]> info_array_; // List of sub-directories. |
dcheng
2013/01/20 01:47:21
FYI, there are some issues we still need to resolv
| |
164 std::string inherits_; // Name of the theme this one inherits from. | 164 std::string inherits_; // Name of the theme this one inherits from. |
165 }; | 165 }; |
166 | 166 |
167 IconTheme::IconTheme(const std::string& name) | 167 IconTheme::IconTheme(const std::string& name) |
168 : index_theme_loaded_(false), | 168 : index_theme_loaded_(false), |
169 info_array_(NULL) { | 169 info_array_(NULL) { |
170 base::ThreadRestrictions::AssertIOAllowed(); | 170 base::ThreadRestrictions::AssertIOAllowed(); |
171 // Iterate on all icon directories to find directories of the specified | 171 // Iterate on all icon directories to find directories of the specified |
172 // theme and load the first encountered index.theme. | 172 // theme and load the first encountered index.theme. |
173 MimeUtilConstants::IconDirMtimeMap::iterator iter; | 173 MimeUtilConstants::IconDirMtimeMap::iterator iter; |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 icon_file = LookupIconInDefaultTheme(icon_names[i], size); | 669 icon_file = LookupIconInDefaultTheme(icon_names[i], size); |
670 if (!icon_file.empty()) | 670 if (!icon_file.empty()) |
671 return icon_file; | 671 return icon_file; |
672 } | 672 } |
673 } | 673 } |
674 return FilePath(); | 674 return FilePath(); |
675 } | 675 } |
676 | 676 |
677 } // namespace nix | 677 } // namespace nix |
678 } // namespace base | 678 } // namespace base |
OLD | NEW |