| Index: base/prefs/pref_paths.cc
|
| diff --git a/ui/gfx/gfx_paths.cc b/base/prefs/pref_paths.cc
|
| similarity index 54%
|
| copy from ui/gfx/gfx_paths.cc
|
| copy to base/prefs/pref_paths.cc
|
| index 6fe47892ad560bf69a79445bcacc2b0bcf30ec0d..1ce0f8b0323d5fcfdb9ca4d7c7e66e019aed9798 100644
|
| --- a/ui/gfx/gfx_paths.cc
|
| +++ b/base/prefs/pref_paths.cc
|
| @@ -1,38 +1,37 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright 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 "ui/gfx/gfx_paths.h"
|
| +#include "base/prefs/pref_paths.h"
|
|
|
| -#include "base/command_line.h"
|
| -#include "base/file_path.h"
|
| #include "base/file_util.h"
|
| #include "base/path_service.h"
|
|
|
| -namespace gfx {
|
| +namespace base {
|
| +namespace prefs {
|
|
|
| bool PathProvider(int key, FilePath* result) {
|
| - FilePath cur;
|
| switch (key) {
|
| - // The following are only valid in the development environment, and
|
| - // will fail if executed from an installed executable (because the
|
| - // generated path won't exist).
|
| - case DIR_TEST_DATA:
|
| + case DIR_TEST_DATA: {
|
| + FilePath cur;
|
| if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
|
| return false;
|
| - cur = cur.Append(FILE_PATH_LITERAL("ui"));
|
| - cur = cur.Append(FILE_PATH_LITERAL("gfx"));
|
| + cur = cur.Append(FILE_PATH_LITERAL("base"));
|
| + cur = cur.Append(FILE_PATH_LITERAL("prefs"));
|
| cur = cur.Append(FILE_PATH_LITERAL("test"));
|
| cur = cur.Append(FILE_PATH_LITERAL("data"));
|
| - if (!file_util::PathExists(cur)) // we don't want to create this
|
| + if (!file_util::PathExists(cur)) // We don't want to create this.
|
| return false;
|
| +
|
| + *result = cur;
|
| + return true;
|
| break;
|
| + }
|
| default:
|
| return false;
|
| }
|
|
|
| - *result = cur;
|
| - return true;
|
| + return false;
|
| }
|
|
|
| // This cannot be done as a static initializer sadly since Visual Studio will
|
| @@ -41,4 +40,5 @@ void RegisterPathProvider() {
|
| PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
|
| }
|
|
|
| -} // namespace gfx
|
| +} // namespace prefs
|
| +} // namespace base
|
|
|