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" |
11 #include "base/mac_util.h" | 11 #include "base/mac_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
14 | 14 |
15 namespace chrome { | 15 namespace chrome { |
16 | 16 |
17 bool GetDefaultUserDataDirectory(FilePath* result) { | 17 bool GetDefaultUserDataDirectory(FilePath* result) { |
18 bool success = false; | 18 bool success = false; |
19 if (result && PathService::Get(base::DIR_APP_DATA, result)) { | 19 if (result && PathService::Get(base::DIR_APP_DATA, result)) { |
20 #if defined(GOOGLE_CHROME_BUILD) | 20 #if defined(GOOGLE_CHROME_BUILD) |
21 *result = result->Append("Google").Append("Chrome"); | 21 *result = result->Append("Google").Append("Chrome"); |
22 #else | 22 #else |
23 *result = result->Append("Chromium"); | 23 *result = result->Append("Chromium"); |
24 #endif | 24 #endif |
25 success = true; | 25 success = true; |
26 } | 26 } |
27 return success; | 27 return success; |
28 } | 28 } |
29 | 29 |
30 bool GetChromeFrameUserDataDirectory(FilePath* result) { | |
31 bool success = false; | |
32 if (result && PathService::Get(base::DIR_APP_DATA, result)) { | |
33 #if defined(GOOGLE_CHROME_BUILD) | |
34 *result = result->Append("Google").Append("Chrome Frame"); | |
35 #else | |
36 *result = result->Append("Chrome Frame"); | |
37 #endif | |
kuchhal
2009/10/27 18:47:26
I think you want to check for Chrome Frame Build.
robertshield
2009/10/27 19:55:37
This method is specific to Chrome Frame and so (as
| |
38 success = true; | |
39 } | |
40 return success; | |
41 } | |
42 | |
30 bool GetUserDocumentsDirectory(FilePath* result) { | 43 bool GetUserDocumentsDirectory(FilePath* result) { |
31 bool success = false; | 44 bool success = false; |
32 NSArray* docArray = | 45 NSArray* docArray = |
33 NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | 46 NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, |
34 NSUserDomainMask, | 47 NSUserDomainMask, |
35 YES); | 48 YES); |
36 if ([docArray count] && result) { | 49 if ([docArray count] && result) { |
37 *result = FilePath([[docArray objectAtIndex:0] fileSystemRepresentation]); | 50 *result = FilePath([[docArray objectAtIndex:0] fileSystemRepresentation]); |
38 success = true; | 51 success = true; |
39 } | 52 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 // needed to compute the framework's path are also effectively free, so that | 112 // needed to compute the framework's path are also effectively free, so that |
100 // is the approach that is used here. NSBundle is also documented as being | 113 // is the approach that is used here. NSBundle is also documented as being |
101 // not thread-safe, and thread safety may be a concern here. | 114 // not thread-safe, and thread safety may be a concern here. |
102 | 115 |
103 // The framework bundle is at a known path and name from the browser .app's | 116 // The framework bundle is at a known path and name from the browser .app's |
104 // versioned directory. | 117 // versioned directory. |
105 return GetVersionedDirectory().Append(kFrameworkName); | 118 return GetVersionedDirectory().Append(kFrameworkName); |
106 } | 119 } |
107 | 120 |
108 } // namespace chrome | 121 } // namespace chrome |
OLD | NEW |