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

Side by Side Diff: base/nix/mime_util_xdg.cc

Issue 93263002: Move some more file utils to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « base/memory/shared_memory_posix.cc ('k') | base/nix/xdg_util.cc » ('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 "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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 // For a xdg directory |dir|, add the appropriate icon sub-directories. 407 // For a xdg directory |dir|, add the appropriate icon sub-directories.
408 void AddXDGDataDir(const FilePath& dir) { 408 void AddXDGDataDir(const FilePath& dir) {
409 if (!DirectoryExists(dir)) 409 if (!DirectoryExists(dir))
410 return; 410 return;
411 TryAddIconDir(dir.Append("icons")); 411 TryAddIconDir(dir.Append("icons"));
412 TryAddIconDir(dir.Append("pixmaps")); 412 TryAddIconDir(dir.Append("pixmaps"));
413 } 413 }
414 414
415 // Add all the xdg icon directories. 415 // Add all the xdg icon directories.
416 void InitIconDir() { 416 void InitIconDir() {
417 FilePath home = file_util::GetHomeDir(); 417 FilePath home = GetHomeDir();
418 if (!home.empty()) { 418 if (!home.empty()) {
419 FilePath legacy_data_dir(home); 419 FilePath legacy_data_dir(home);
420 legacy_data_dir = legacy_data_dir.AppendASCII(".icons"); 420 legacy_data_dir = legacy_data_dir.AppendASCII(".icons");
421 if (DirectoryExists(legacy_data_dir)) 421 if (DirectoryExists(legacy_data_dir))
422 TryAddIconDir(legacy_data_dir); 422 TryAddIconDir(legacy_data_dir);
423 } 423 }
424 const char* env = getenv("XDG_DATA_HOME"); 424 const char* env = getenv("XDG_DATA_HOME");
425 if (env) { 425 if (env) {
426 AddXDGDataDir(FilePath(env)); 426 AddXDGDataDir(FilePath(env));
427 } else if (!home.empty()) { 427 } else if (!home.empty()) {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 icon_file = LookupIconInDefaultTheme(icon_names[i], size); 646 icon_file = LookupIconInDefaultTheme(icon_names[i], size);
647 if (!icon_file.empty()) 647 if (!icon_file.empty())
648 return icon_file; 648 return icon_file;
649 } 649 }
650 } 650 }
651 return FilePath(); 651 return FilePath();
652 } 652 }
653 653
654 } // namespace nix 654 } // namespace nix
655 } // namespace base 655 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_posix.cc ('k') | base/nix/xdg_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698