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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 return false; | 380 return false; |
381 } | 381 } |
382 subdirs_[dir] = num++; | 382 subdirs_[dir] = num++; |
383 info_array_.reset(new SubDirInfo[num]); | 383 info_array_.reset(new SubDirInfo[num]); |
384 return true; | 384 return true; |
385 } | 385 } |
386 | 386 |
387 bool CheckDirExistsAndGetMtime(const FilePath& dir, Time* last_modified) { | 387 bool CheckDirExistsAndGetMtime(const FilePath& dir, Time* last_modified) { |
388 if (!DirectoryExists(dir)) | 388 if (!DirectoryExists(dir)) |
389 return false; | 389 return false; |
390 PlatformFileInfo file_info; | 390 File::Info file_info; |
391 if (!GetFileInfo(dir, &file_info)) | 391 if (!GetFileInfo(dir, &file_info)) |
392 return false; | 392 return false; |
393 *last_modified = file_info.last_modified; | 393 *last_modified = file_info.last_modified; |
394 return true; | 394 return true; |
395 } | 395 } |
396 | 396 |
397 // Make sure |dir| exists and add it to the list of icon directories. | 397 // Make sure |dir| exists and add it to the list of icon directories. |
398 void TryAddIconDir(const FilePath& dir) { | 398 void TryAddIconDir(const FilePath& dir) { |
399 Time last_modified; | 399 Time last_modified; |
400 if (!CheckDirExistsAndGetMtime(dir, &last_modified)) | 400 if (!CheckDirExistsAndGetMtime(dir, &last_modified)) |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 icon_file = LookupIconInDefaultTheme(icon_names[i], size); | 644 icon_file = LookupIconInDefaultTheme(icon_names[i], size); |
645 if (!icon_file.empty()) | 645 if (!icon_file.empty()) |
646 return icon_file; | 646 return icon_file; |
647 } | 647 } |
648 } | 648 } |
649 return FilePath(); | 649 return FilePath(); |
650 } | 650 } |
651 | 651 |
652 } // namespace nix | 652 } // namespace nix |
653 } // namespace base | 653 } // namespace base |
OLD | NEW |