Home | History | Annotate | Download | only in common
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_COMMON_CHROME_PATHS_INTERNAL_H_
      6 #define CHROME_COMMON_CHROME_PATHS_INTERNAL_H_
      7 #pragma once
      8 
      9 #include "build/build_config.h"
     10 
     11 class FilePath;
     12 
     13 namespace chrome {
     14 
     15 // Get the path to the user's data directory, regardless of whether
     16 // DIR_USER_DATA has been overridden by a command-line option.
     17 bool GetDefaultUserDataDirectory(FilePath* result);
     18 
     19 // This returns the base directory in which Chrome Frame stores user profiles.
     20 // Note that this cannot be wrapped in a preprocessor define since
     21 // CF and Google Chrome want to share the same binaries.
     22 bool GetChromeFrameUserDataDirectory(FilePath* result);
     23 
     24 // Get the path to the user's cache directory.  This is normally the
     25 // same as the profile directory, but on Linux it can also be
     26 // $XDG_CACHE_HOME and on Mac it can be under ~/Library/Caches.
     27 // Note that the Chrome cache directories are actually subdirectories
     28 // of this directory, with names like "Cache" and "Media Cache".
     29 // This will always fill in |result| with a directory, sometimes
     30 // just |profile_dir|.
     31 void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result);
     32 
     33 // Get the path to the user's documents directory.
     34 bool GetUserDocumentsDirectory(FilePath* result);
     35 
     36 #if defined (OS_WIN)
     37 // Gets the path to a safe default download directory for a user.
     38 bool GetUserDownloadsDirectorySafe(FilePath* result);
     39 #endif
     40 
     41 // Get the path to the user's downloads directory.
     42 bool GetUserDownloadsDirectory(FilePath* result);
     43 
     44 // The path to the user's desktop.
     45 bool GetUserDesktop(FilePath* result);
     46 
     47 #if defined(OS_MACOSX)
     48 // The "versioned directory" is a directory in the browser .app bundle.  It
     49 // contains the bulk of the application, except for the things that the system
     50 // requires be located at spepcific locations.  The versioned directory is
     51 // in the .app at Contents/Versions/w.x.y.z.
     52 FilePath GetVersionedDirectory();
     53 
     54 // This overrides the directory returned by |GetVersionedDirectory()|, to be
     55 // used when |GetVersionedDirectory()| can't automatically determine the proper
     56 // location. This is the case when the browser didn't load itself but by, e.g.,
     57 // the app mode loader. This should be called before |ChromeMain()|. This takes
     58 // ownership of the object |path| and the caller must not delete it.
     59 void SetOverrideVersionedDirectory(const FilePath* path);
     60 
     61 // Most of the application is further contained within the framework.  The
     62 // framework bundle is located within the versioned directory at a specific
     63 // path.  The only components in the versioned directory not included in the
     64 // framework are things that also depend on the framework, such as the helper
     65 // app bundle.
     66 FilePath GetFrameworkBundlePath();
     67 
     68 // Get the local library directory.
     69 bool GetLocalLibraryDirectory(FilePath* result);
     70 
     71 #endif  // OS_MACOSX
     72 
     73 }  // namespace chrome
     74 
     75 #endif  // CHROME_COMMON_CHROME_PATHS_INTERNAL_H_
     76