root/chrome/common/chrome_paths_android.cc

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. GetUserCacheDirectory
  2. GetDefaultUserDataDirectory
  3. GetUserDocumentsDirectory
  4. GetUserDownloadsDirectory
  5. GetUserMusicDirectory
  6. GetUserPicturesDirectory
  7. GetUserVideosDirectory
  8. ProcessNeedsProfileDir

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/common/chrome_paths_internal.h"

#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/path_service.h"

namespace chrome {

void GetUserCacheDirectory(const base::FilePath& profile_dir,
                           base::FilePath* result) {
  if (!PathService::Get(base::DIR_CACHE, result))
    *result = profile_dir;
}

bool GetDefaultUserDataDirectory(base::FilePath* result) {
  return PathService::Get(base::DIR_ANDROID_APP_DATA, result);
}

bool GetUserDocumentsDirectory(base::FilePath* result) {
  if (!GetDefaultUserDataDirectory(result))
    return false;
  *result = result->Append("Documents");
  return true;
}

bool GetUserDownloadsDirectory(base::FilePath* result) {
  if (!GetDefaultUserDataDirectory(result))
    return false;
  *result = result->Append("Downloads");
  return true;
}

bool GetUserMusicDirectory(base::FilePath* result) {
  NOTIMPLEMENTED();
  return false;
}

bool GetUserPicturesDirectory(base::FilePath* result) {
  NOTIMPLEMENTED();
  return false;
}

bool GetUserVideosDirectory(base::FilePath* result) {
  NOTIMPLEMENTED();
  return false;
}

bool ProcessNeedsProfileDir(const std::string& process_type) {
  return true;
}

}  // namespace chrome

/* [<][>][^][v][top][bottom][index][help] */