OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 } | 57 } |
58 | 58 |
59 FilePath GetVersionedDirectory() { | 59 FilePath GetVersionedDirectory() { |
60 if (g_override_versioned_directory) | 60 if (g_override_versioned_directory) |
61 return *g_override_versioned_directory; | 61 return *g_override_versioned_directory; |
62 | 62 |
63 // Start out with the path to the running executable. | 63 // Start out with the path to the running executable. |
64 FilePath path; | 64 FilePath path; |
65 PathService::Get(base::FILE_EXE, &path); | 65 PathService::Get(base::FILE_EXE, &path); |
66 | 66 |
67 if (path.DirName().BaseName() != FilePath("MacOS")) { | |
68 // Raw test binary. | |
Mark Mentovai
2010/11/15 17:50:01
Care to elaborate?
| |
69 path = path.DirName().Append( | |
70 FilePath::FromWStringHack(kBrowserProcessExecutablePath)); | |
71 } | |
72 | |
67 // One step up to MacOS, another to Contents. | 73 // One step up to MacOS, another to Contents. |
68 path = path.DirName().DirName(); | 74 path = path.DirName().DirName(); |
69 DCHECK_EQ(path.BaseName().value(), "Contents"); | 75 DCHECK_EQ(path.BaseName().value(), "Contents"); |
70 | 76 |
71 if (mac_util::IsBackgroundOnlyProcess()) { | 77 if (mac_util::IsBackgroundOnlyProcess()) { |
72 // path identifies the helper .app's Contents directory in the browser | 78 // path identifies the helper .app's Contents directory in the browser |
73 // .app's versioned directory. Go up two steps to get to the browser | 79 // .app's versioned directory. Go up two steps to get to the browser |
74 // .app's versioned directory. | 80 // .app's versioned directory. |
75 path = path.DirName().DirName(); | 81 path = path.DirName().DirName(); |
76 DCHECK_EQ(path.BaseName().value(), kChromeVersion); | 82 DCHECK_EQ(path.BaseName().value(), kChromeVersion); |
(...skipping 26 matching lines...) Expand all Loading... | |
103 // The framework bundle is at a known path and name from the browser .app's | 109 // The framework bundle is at a known path and name from the browser .app's |
104 // versioned directory. | 110 // versioned directory. |
105 return GetVersionedDirectory().Append(kFrameworkName); | 111 return GetVersionedDirectory().Append(kFrameworkName); |
106 } | 112 } |
107 | 113 |
108 bool GetLocalLibraryDirectory(FilePath* result) { | 114 bool GetLocalLibraryDirectory(FilePath* result) { |
109 return mac_util::GetLocalDirectory(NSLibraryDirectory, result); | 115 return mac_util::GetLocalDirectory(NSLibraryDirectory, result); |
110 } | 116 } |
111 | 117 |
112 } // namespace chrome | 118 } // namespace chrome |
OLD | NEW |