diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 16:24:52 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-20 16:24:52 +0000 |
commit | dea1d7d21976d078a41b2d321e8d626379c7a1fd (patch) | |
tree | 02587faedfbf8242cc8b557874d3c37a435739de /base/base_paths_android.cc | |
parent | 6c2e391ce50adde6f5080245b1256838656063d3 (diff) | |
download | chromium_src-dea1d7d21976d078a41b2d321e8d626379c7a1fd.zip chromium_src-dea1d7d21976d078a41b2d321e8d626379c7a1fd.tar.gz chromium_src-dea1d7d21976d078a41b2d321e8d626379c7a1fd.tar.bz2 |
Add new PathService paths for Windows' All Users Desktop and Quick Launch folders.
Re-commit, reverted in http://crrev.com/157680 (original commit in http://crrev.com/157667).
This allows usage of PathService to cache the shortcut install paths and more importantly to mock them in shortcut tests!
Also move chrome::DIR_USER_DESKTOP to base::DIR_USER_DESKTOP; this is really where it belongs. In fact it is only in chrome_paths.h because it used to be called DIR_DEFAULT_DOWNLOAD and cpu@ renamed it to DIR_USER_DESKTOP in http://crrev.com/1753 (early days!) after that it started to be used all over the place as the Desktop path. Finally bringing it to base_paths.h, beside DIR_START_MENU and friends, is the right thing to do imo.
TBR=brettw@chromium.org
BUG=148539
TEST=Quick Launch shortcut installed in the right place on XP (both Default and current user)
Desktop shortcuts installed in the right place (both All Users and per-user installs).
installer_util_unittests.exe --gtest_filter=ShellUtilShortcutTest*
unit_tests.exe --gtest_filter=ProfileShortcutManagerTest*
base_unittests --gtest_filter=PathServiceTest*
Review URL: https://chromiumcodereview.appspot.com/10964007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_android.cc')
-rw-r--r-- | base/base_paths_android.cc | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/base/base_paths_android.cc b/base/base_paths_android.cc index f631c61..ab14ee3 100644 --- a/base/base_paths_android.cc +++ b/base/base_paths_android.cc @@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/base_paths.h" +// Defines base::PathProviderAndroid which replaces base::PathProviderPosix for +// Android in base/path_service.cc. #include <unistd.h> #include "base/android/jni_android.h" #include "base/android/path_utils.h" +#include "base/base_paths.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" @@ -28,42 +30,38 @@ bool PathProviderAndroid(int key, FilePath* result) { *result = FilePath(bin_dir); return true; } - case base::FILE_MODULE: { + case base::FILE_MODULE: // dladdr didn't work in Android as only the file name was returned. NOTIMPLEMENTED(); return false; - } - case base::DIR_MODULE: { + case base::DIR_MODULE: *result = FilePath(base::android::GetNativeLibraryDirectory()); return true; - } - case base::DIR_SOURCE_ROOT: { + case base::DIR_SOURCE_ROOT: // This const is only used for tests. *result = FilePath(base::android::GetExternalStorageDirectory()); return true; - } - case base::DIR_CACHE: { + case base::DIR_USER_DESKTOP: + // Android doesn't support GetUserDesktop. + NOTIMPLEMENTED(); + return false; + case base::DIR_CACHE: *result = FilePath(base::android::GetCacheDirectory()); return true; - } - case base::DIR_ANDROID_APP_DATA: { + case base::DIR_ANDROID_APP_DATA: *result = FilePath(base::android::GetDataDirectory()); return true; - } - case base::DIR_HOME: { + case base::DIR_HOME: *result = file_util::GetHomeDir(); return true; - } - case base::DIR_ANDROID_EXTERNAL_STORAGE: { + case base::DIR_ANDROID_EXTERNAL_STORAGE: *result = FilePath(base::android::GetExternalStorageDirectory()); return true; - } - default: { + default: // Note: the path system expects this function to override the default // behavior. So no need to log an error if we don't support a given // path. The system will just use the default. return false; - } } } |