diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 21:43:58 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-27 21:43:58 +0000 |
commit | 8463c8db63491878163fa0a43b31be61fb8ccf54 (patch) | |
tree | 94de537edf13c519cd4b3c0d17d76aca28fa210c | |
parent | 88b460b939077577521fe6119a3682b17992eeae (diff) | |
download | chromium_src-8463c8db63491878163fa0a43b31be61fb8ccf54.zip chromium_src-8463c8db63491878163fa0a43b31be61fb8ccf54.tar.gz chromium_src-8463c8db63491878163fa0a43b31be61fb8ccf54.tar.bz2 |
app: Get rid of app_paths.[cc,h] files.
BUG=72317
TEST=None
R=rsesek@chromium.org
Review URL: http://codereview.chromium.org/7262020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90651 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | app/app_base.gypi | 4 | ||||
-rw-r--r-- | app/app_paths.cc | 54 | ||||
-rw-r--r-- | app/app_paths.h | 27 | ||||
-rw-r--r-- | chrome/app/chrome_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/diagnostics/diagnostics_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/external_extension_provider_impl.cc | 3 | ||||
-rw-r--r-- | chrome/browser/extensions/external_pref_extension_loader.cc | 1 | ||||
-rw-r--r-- | chrome/common/chrome_paths.cc | 14 | ||||
-rw-r--r-- | chrome/common/chrome_paths.h | 2 | ||||
-rw-r--r-- | chrome/test/unit/chrome_test_suite.cc | 2 | ||||
-rw-r--r-- | chrome/tools/profiles/generate_profile.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/net/fake_external_tab.cc | 3 |
12 files changed, 17 insertions, 99 deletions
diff --git a/app/app_base.gypi b/app/app_base.gypi index 05c5696..31540c8 100644 --- a/app/app_base.gypi +++ b/app/app_base.gypi @@ -24,8 +24,6 @@ '../base/base.gyp:base_static', ], 'sources': [ - 'app_paths.h', - 'app_paths.cc', 'sql/connection.cc', 'sql/connection.h', 'sql/diagnostic_error_delegate.h', @@ -54,8 +52,6 @@ '../ui/base/ui_base_paths.cc', '../ui/base/ui_base_switches.h', '../ui/base/ui_base_switches.cc', - 'app_paths.h', - 'app_paths.cc', ], 'include_dirs': [ '..', diff --git a/app/app_paths.cc b/app/app_paths.cc deleted file mode 100644 index 4b0c873..0000000 --- a/app/app_paths.cc +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2010 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 "app/app_paths.h" - -#include "base/command_line.h" -#include "base/file_path.h" -#include "base/file_util.h" -#include "base/logging.h" -#include "base/path_service.h" - -namespace app { - -bool PathProvider(int key, FilePath* result) { - // Assume that we will not need to create the directory if it does not exist. - // This flag can be set to true for the cases where we want to create it. - bool create_dir = false; - - FilePath cur; - switch (key) { - case app::DIR_EXTERNAL_EXTENSIONS: - if (!PathService::Get(base::DIR_MODULE, &cur)) - return false; -#if defined(OS_MACOSX) - // On Mac, built-in extensions are in Contents/Extensions, a sibling of - // the App dir. If there are none, it may not exist. - cur = cur.DirName(); - cur = cur.Append(FILE_PATH_LITERAL("Extensions")); - create_dir = false; -#else - cur = cur.Append(FILE_PATH_LITERAL("extensions")); - create_dir = true; -#endif - break; - default: - return false; - } - - if (create_dir && !file_util::PathExists(cur) && - !file_util::CreateDirectory(cur)) - return false; - - *result = cur; - return true; -} - -// This cannot be done as a static initializer sadly since Visual Studio will -// eliminate this object file if there is no direct entry point into it. -void RegisterPathProvider() { - PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); -} - -} // namespace app diff --git a/app/app_paths.h b/app/app_paths.h deleted file mode 100644 index d1cf12f0..0000000 --- a/app/app_paths.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2010 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. - -#ifndef APP_APP_PATHS_H_ -#define APP_APP_PATHS_H_ -#pragma once - -// This file declares path keys for the app module. These can be used with -// the PathService to access various special directories and files. - -namespace app { - -enum { - PATH_START = 2000, - - DIR_EXTERNAL_EXTENSIONS, // Directory where installer places .crx files. - - PATH_END -}; - -// Call once to register the provider for the path keys defined above. -void RegisterPathProvider(); - -} // namespace app - -#endif // APP_APP_PATHS_H_ diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index 86c0cf5..bc8b594 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -4,7 +4,6 @@ #include "chrome/app/chrome_main.h" -#include "app/app_paths.h" #include "base/at_exit.h" #include "base/command_line.h" #include "base/debug/debugger.h" @@ -645,7 +644,6 @@ int ChromeMain(int argc, char** argv) { #endif // Initialize the Chrome path provider. - app::RegisterPathProvider(); ui::RegisterPathProvider(); chrome::RegisterPathProvider(); content::RegisterPathProvider(); diff --git a/chrome/browser/diagnostics/diagnostics_main.cc b/chrome/browser/diagnostics/diagnostics_main.cc index a54bd10..0f850dc 100644 --- a/chrome/browser/diagnostics/diagnostics_main.cc +++ b/chrome/browser/diagnostics/diagnostics_main.cc @@ -11,7 +11,6 @@ #include <iostream> -#include "app/app_paths.h" #include "base/basictypes.h" #include "base/command_line.h" #include "base/i18n/icu_util.h" @@ -349,7 +348,6 @@ int DiagnosticsMain(const CommandLine& command_line) { // We need to have the path providers registered. They both // return void so there is no early error signal that we can use. - app::RegisterPathProvider(); ui::RegisterPathProvider(); chrome::RegisterPathProvider(); diff --git a/chrome/browser/extensions/external_extension_provider_impl.cc b/chrome/browser/extensions/external_extension_provider_impl.cc index 10a0e11..f288af0 100644 --- a/chrome/browser/extensions/external_extension_provider_impl.cc +++ b/chrome/browser/extensions/external_extension_provider_impl.cc @@ -4,7 +4,6 @@ #include "chrome/browser/extensions/external_extension_provider_impl.h" -#include "app/app_paths.h" #include "base/file_path.h" #include "base/logging.h" #include "base/memory/linked_ptr.h" @@ -228,7 +227,7 @@ void ExternalExtensionProviderImpl::CreateExternalProviders( new ExternalExtensionProviderImpl( service, new ExternalPrefExtensionLoader( - app::DIR_EXTERNAL_EXTENSIONS), + chrome::DIR_EXTERNAL_EXTENSIONS), Extension::EXTERNAL_PREF, Extension::EXTERNAL_PREF_DOWNLOAD))); diff --git a/chrome/browser/extensions/external_pref_extension_loader.cc b/chrome/browser/extensions/external_pref_extension_loader.cc index a0aa3e3..37b7b8f 100644 --- a/chrome/browser/extensions/external_pref_extension_loader.cc +++ b/chrome/browser/extensions/external_pref_extension_loader.cc @@ -4,7 +4,6 @@ #include "chrome/browser/extensions/external_pref_extension_loader.h" -#include "app/app_paths.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/logging.h" diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index a8d1dd8..9b817d3 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -308,6 +308,20 @@ bool PathProvider(int key, FilePath* result) { break; } #endif + case chrome::DIR_EXTERNAL_EXTENSIONS: + if (!PathService::Get(base::DIR_MODULE, &cur)) + return false; +#if defined(OS_MACOSX) + // On Mac, built-in extensions are in Contents/Extensions, a sibling of + // the App dir. If there are none, it may not exist. + cur = cur.DirName(); + cur = cur.Append(FILE_PATH_LITERAL("Extensions")); + create_dir = false; +#else + cur = cur.Append(FILE_PATH_LITERAL("extensions")); + create_dir = true; +#endif + break; default: return false; } diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index 8b91c49..918ba41 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -56,6 +56,7 @@ enum { // Getting this path does not create it. #endif + DIR_EXTERNAL_EXTENSIONS, // Directory where installer places .crx files. FILE_RESOURCE_MODULE, // Full path and filename of the module that // contains embedded resources (version, // strings, images, etc.). @@ -79,7 +80,6 @@ enum { FILE_CHROMEOS_API, // Full path to chrome os api shared object. #endif - // Valid only in development environment; TODO(darin): move these DIR_TEST_DATA, // Directory where unit test data resides. DIR_TEST_TOOLS, // Directory where unit test tools reside. diff --git a/chrome/test/unit/chrome_test_suite.cc b/chrome/test/unit/chrome_test_suite.cc index 09e184d..4a68fe1 100644 --- a/chrome/test/unit/chrome_test_suite.cc +++ b/chrome/test/unit/chrome_test_suite.cc @@ -4,7 +4,6 @@ #include "chrome/test/unit/chrome_test_suite.h" -#include "app/app_paths.h" #include "base/command_line.h" #include "base/mac/scoped_nsautorelease_pool.h" #include "base/metrics/stats_table.h" @@ -109,7 +108,6 @@ void ChromeTestSuite::Initialize() { scoped_host_resolver_proc_.Init(host_resolver_proc_.get()); chrome::RegisterPathProvider(); - app::RegisterPathProvider(); content::RegisterPathProvider(); ui::RegisterPathProvider(); g_browser_process = new TestingBrowserProcess; diff --git a/chrome/tools/profiles/generate_profile.cc b/chrome/tools/profiles/generate_profile.cc index 1da6289..f392137 100644 --- a/chrome/tools/profiles/generate_profile.cc +++ b/chrome/tools/profiles/generate_profile.cc @@ -7,7 +7,6 @@ #include "chrome/tools/profiles/thumbnail-inl.h" -#include "app/app_paths.h" #include "base/at_exit.h" #include "base/command_line.h" #include "base/file_path.h" @@ -233,7 +232,6 @@ int main(int argc, const char* argv[]) { icu_util::Initialize(); chrome::RegisterPathProvider(); - app::RegisterPathProvider(); ui::RegisterPathProvider(); ResourceBundle::InitSharedInstance("en-US"); NotificationService notification_service; diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index d85cc0c..9862f91 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -8,7 +8,6 @@ #include <atlcom.h> #include <exdisp.h> -#include "app/app_paths.h" #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/file_util.h" @@ -231,7 +230,7 @@ void FakeExternalTab::Initialize() { icu_util::Initialize(); TestTimeouts::Initialize(); - app::RegisterPathProvider(); + chrome::RegisterPathProvider(); content::RegisterPathProvider(); ui::RegisterPathProvider(); |