summaryrefslogtreecommitdiffstats
path: root/chrome/browser/google_update_settings_mac.mm
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 21:49:05 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 21:49:05 +0000
commit1d8e4ce0743eed37a143d99e568c28abbe3202f1 (patch)
treece8c850b2fa6d8a87f419255c368817c02f23a4f /chrome/browser/google_update_settings_mac.mm
parentf59a9c06d5cc9b7e0faace2b76582d3a12c3ec6c (diff)
downloadchromium_src-1d8e4ce0743eed37a143d99e568c28abbe3202f1.zip
chromium_src-1d8e4ce0743eed37a143d99e568c28abbe3202f1.tar.gz
chromium_src-1d8e4ce0743eed37a143d99e568c28abbe3202f1.tar.bz2
Implement temporary First Run Dialog on OS X
We use a modal dialog with a single checkbox on OS X. We use the OSX defaults system since we want something quick and reliable. The dialog is displayed at a very early stage in Chrome startup (Before any subsystems start relying on the stats variable). This means there are a few quirks in displaying the UI. A change was also needed to our event handling code since when the dialog is shown we spin an event loop at a very early stage in the process lifetime. Changed default value for stats to false and updated unit tests to reflect that. Also some misc. minor cleanup. BUG=11971,12046 Review URL: http://codereview.chromium.org/115608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/google_update_settings_mac.mm')
-rw-r--r--chrome/browser/google_update_settings_mac.mm12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/google_update_settings_mac.mm b/chrome/browser/google_update_settings_mac.mm
index a246803..95ca90e 100644
--- a/chrome/browser/google_update_settings_mac.mm
+++ b/chrome/browser/google_update_settings_mac.mm
@@ -23,14 +23,14 @@ namespace google_update {
const wchar_t kRegUsageStatsField[] = L"usagestats";
// Declared in a public namespace for testing purposes.
-// If pref not set, assume true.
+// 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 true;
+ return false;
}
return ([val boolValue] == YES);
@@ -52,8 +52,12 @@ bool GoogleUpdateSettings::GetCollectStatsConsent() {
// static
bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
- NOTIMPLEMENTED();
- return false;
+ 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