Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2273)

Unified Diff: chrome/browser/mac/master_prefs.mm

Issue 7655056: Enable brand codes and master preferences on the Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: expando Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/mac/master_prefs.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mac/master_prefs.mm
diff --git a/chrome/browser/mac/master_prefs.mm b/chrome/browser/mac/master_prefs.mm
new file mode 100644
index 0000000000000000000000000000000000000000..dae0f2e3b570e1c91ca438fb351dd46e65aa1abd
--- /dev/null
+++ b/chrome/browser/mac/master_prefs.mm
@@ -0,0 +1,43 @@
+// Copyright (c) 2011 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 "chrome/browser/mac/master_prefs.h"
+
+#include "base/mac/foundation_util.h"
+#include "chrome/common/chrome_version_info.h"
+
+#if defined(GOOGLE_CHROME_BUILD)
+
+namespace {
+
+const char kGoogleDirectory[] = "Google";
+const char kMasterPreferencesFileName[] = "Google Chrome Master Preferences";
+
+} // namespace
+
+#endif // GOOGLE_CHROME_BUILD
+
+namespace master_prefs {
+
+FilePath MasterPrefsPath() {
+#if defined(GOOGLE_CHROME_BUILD)
+ // There is only a system-level master preferences file, and only for the
+ // official build, and not for the canary.
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+
+ if (channel == chrome::VersionInfo::CHANNEL_CANARY)
+ return FilePath();
+
+ FilePath library_path;
+ if (!base::mac::GetLocalDirectory(NSLibraryDirectory, &library_path))
+ return FilePath();
+
+ return library_path.Append(kGoogleDirectory)
+ .Append(kMasterPreferencesFileName);
+#else
+ return FilePath();
+#endif // GOOGLE_CHROME_BUILD
+}
+
+} // namespace master_prefs
« no previous file with comments | « chrome/browser/mac/master_prefs.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698