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

Unified Diff: chrome/browser/google_update_settings_mac.mm

Issue 173020: Make Mac first run store sentinel in Profile directory. (Closed)
Patch Set: spelling Created 11 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
Index: chrome/browser/google_update_settings_mac.mm
diff --git a/chrome/browser/google_update_settings_mac.mm b/chrome/browser/google_update_settings_mac.mm
index 3462b709fbea9e053a87188cf2bdc97c3708c7ee..d69709ff3b6a633c76d69d7c55159f015929ec30 100644
--- a/chrome/browser/google_update_settings_mac.mm
+++ b/chrome/browser/google_update_settings_mac.mm
@@ -11,55 +11,6 @@
#include "base/sys_string_conversions.h"
#include "chrome/installer/util/google_update_constants.h"
-namespace google_update {
-
-// This is copied from chrome/installer/util/google_update_constants.cc
-// Reasons duplication acceptable:
-// 1. At the time of this writing, this code is a one-off for the dev release.
-// 2. The value of this constant is unlikely to change and even if it does
-// that negates the point of reusing it in the Mac version.
-// 3. To make x-platform usage fo the constants in google_update_constants.cc
-// we probably want to split them up into windows-only and x-platform strings.
-const wchar_t kRegUsageStatsField[] = L"usagestats";
-
-// Declared in a public namespace for testing purposes.
-// If pref not set, assume false.
-bool GetCollectStatsConsentFromDictionary(NSDictionary* dict) {
- NSString* collect_stats_key = base::SysWideToNSString(
- google_update::kRegUsageStatsField);
- NSNumber* val = [dict objectForKey:collect_stats_key];
-
- if (![val respondsToSelector:@selector(boolValue)]) {
- return false;
- }
-
- return ([val boolValue] == YES);
-}
-
-} // namespace google_update
-
-// static
-bool GoogleUpdateSettings::GetCollectStatsConsent() {
- // TODO(mac): This value should be read from the Chrome prefs setting.
- // For Dev-release purposes, we read this value from the user's
- // defaults. This allows easy control of the setting from the terminal.
- // To turn stat reporting off, run the following command from the terminal:
- // $ defaults write com.google.Chrome usagestats -bool 'NO'
- NSUserDefaults* std_defaults = [NSUserDefaults standardUserDefaults];
- return google_update::GetCollectStatsConsentFromDictionary(
- [std_defaults dictionaryRepresentation]);
-}
-
-// static
-bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
- NSString* collect_stats_key = base::SysWideToNSString(
- google_update::kRegUsageStatsField);
- NSUserDefaults* std_defaults = [NSUserDefaults standardUserDefaults];
- BOOL val_to_store = consented ? YES : NO;
- [std_defaults setBool:val_to_store forKey:collect_stats_key];
- return [std_defaults synchronize];
-}
-
// static
bool GoogleUpdateSettings::GetBrowser(std::wstring* browser) {
NOTIMPLEMENTED();

Powered by Google App Engine
This is Rietveld 408576698