1 : // Copyright (c) 2006-2008 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 : #include "chrome/common/chrome_paths.h"
6 :
7 : #include "base/command_line.h"
8 : #include "base/file_path.h"
9 : #include "base/file_util.h"
10 : #include "base/logging.h"
11 : #include "base/path_service.h"
12 : #include "base/string_util.h"
13 : #include "base/sys_info.h"
14 : #include "chrome/common/chrome_constants.h"
15 : #include "chrome/common/chrome_paths_internal.h"
16 : #include "chrome/common/chrome_switches.h"
17 :
18 : namespace chrome {
19 :
20 0 : bool GetGearsPluginPathFromCommandLine(FilePath* path) {
21 : #ifndef NDEBUG
22 : // for debugging, support a cmd line based override
23 : std::wstring plugin_path = CommandLine::ForCurrentProcess()->GetSwitchValue(
24 0 : switches::kGearsPluginPathOverride);
25 : // TODO(tc): After GetSwitchNativeValue lands, we don't need to use
26 : // FromWStringHack.
27 0 : *path = FilePath::FromWStringHack(plugin_path);
28 0 : return !plugin_path.empty();
29 : #else
30 : return false;
31 : #endif
32 : }
33 :
34 0 : bool PathProvider(int key, FilePath* result) {
35 0 : return true;
36 : }
37 :
38 : // This cannot be done as a static initializer sadly since Visual Studio will
39 : // eliminate this object file if there is no direct entry point into it.
40 0 : void RegisterPathProvider() {
41 0 : PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
42 0 : }
43 :
44 : } // namespace chrome
|