OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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/browser/mac/master_prefs.h" |
| 6 |
| 7 #include "base/mac/foundation_util.h" |
| 8 #include "chrome/common/chrome_version_info.h" |
| 9 |
| 10 #if defined(GOOGLE_CHROME_BUILD) |
| 11 |
| 12 namespace { |
| 13 |
| 14 const char kGoogleDirectory[] = "Google"; |
| 15 const char kMasterPreferencesFileName[] = "Google Chrome Master Preferences"; |
| 16 |
| 17 } // namespace |
| 18 |
| 19 #endif // GOOGLE_CHROME_BUILD |
| 20 |
| 21 namespace master_prefs { |
| 22 |
| 23 FilePath MasterPrefsPath() { |
| 24 #if defined(GOOGLE_CHROME_BUILD) |
| 25 // There is only a system-level master preferences file, and only for the |
| 26 // official build, and not for the canary. |
| 27 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 28 |
| 29 if (channel == chrome::VersionInfo::CHANNEL_CANARY) |
| 30 return FilePath(); |
| 31 |
| 32 FilePath library_path; |
| 33 if (!base::mac::GetLocalDirectory(NSLibraryDirectory, &library_path)) |
| 34 return FilePath(); |
| 35 |
| 36 return library_path.Append(kGoogleDirectory) |
| 37 .Append(kMasterPreferencesFileName); |
| 38 #else |
| 39 return FilePath(); |
| 40 #endif // GOOGLE_CHROME_BUILD |
| 41 } |
| 42 |
| 43 } // namespace master_prefs |
OLD | NEW |