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

Side by Side Diff: chrome/browser/ui/cocoa/first_run_dialog.mm

Issue 312583002: Move MetricsStateManager into the Metrics component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/first_run_dialog.h" 5 #import "chrome/browser/ui/cocoa/first_run_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #import "base/mac/scoped_nsobject.h" 10 #import "base/mac/scoped_nsobject.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 bool ShowFirstRun(Profile* profile) { 82 bool ShowFirstRun(Profile* profile) {
83 bool dialog_shown = false; 83 bool dialog_shown = false;
84 #if defined(GOOGLE_CHROME_BUILD) 84 #if defined(GOOGLE_CHROME_BUILD)
85 // The purpose of the dialog is to ask the user to enable stats and crash 85 // The purpose of the dialog is to ask the user to enable stats and crash
86 // reporting. This setting may be controlled through configuration management 86 // reporting. This setting may be controlled through configuration management
87 // in enterprise scenarios. If that is the case, skip the dialog entirely, as 87 // in enterprise scenarios. If that is the case, skip the dialog entirely, as
88 // it's not worth bothering the user for only the default browser question 88 // it's not worth bothering the user for only the default browser question
89 // (which is likely to be forced in enterprise deployments anyway). 89 // (which is likely to be forced in enterprise deployments anyway).
90 const PrefService::Preference* metrics_reporting_pref = 90 const PrefService::Preference* metrics_reporting_pref =
91 g_browser_process->local_state()->FindPreference( 91 g_browser_process->local_state()->FindPreference(
92 prefs::kMetricsReportingEnabled); 92 metrics::prefs::kMetricsReportingEnabled);
93 if (!metrics_reporting_pref || !metrics_reporting_pref->IsManaged()) { 93 if (!metrics_reporting_pref || !metrics_reporting_pref->IsManaged()) {
94 base::scoped_nsobject<FirstRunDialogController> dialog( 94 base::scoped_nsobject<FirstRunDialogController> dialog(
95 [[FirstRunDialogController alloc] init]); 95 [[FirstRunDialogController alloc] init]);
96 96
97 [dialog.get() showWindow:nil]; 97 [dialog.get() showWindow:nil];
98 dialog_shown = true; 98 dialog_shown = true;
99 99
100 // If the dialog asked the user to opt-in for stats and crash reporting, 100 // If the dialog asked the user to opt-in for stats and crash reporting,
101 // record the decision and enable the crash reporter if appropriate. 101 // record the decision and enable the crash reporter if appropriate.
102 bool stats_enabled = [dialog.get() statsEnabled]; 102 bool stats_enabled = [dialog.get() statsEnabled];
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 [NSApp stopModal]; 289 [NSApp stopModal];
290 } 290 }
291 291
292 - (IBAction)learnMore:(id)sender { 292 - (IBAction)learnMore:(id)sender {
293 NSString* urlStr = base::SysUTF8ToNSString(chrome::kLearnMoreReportingURL); 293 NSString* urlStr = base::SysUTF8ToNSString(chrome::kLearnMoreReportingURL);
294 NSURL* learnMoreUrl = [NSURL URLWithString:urlStr]; 294 NSURL* learnMoreUrl = [NSURL URLWithString:urlStr];
295 [[NSWorkspace sharedWorkspace] openURL:learnMoreUrl]; 295 [[NSWorkspace sharedWorkspace] openURL:learnMoreUrl];
296 } 296 }
297 297
298 @end 298 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698