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

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

Issue 2215993002: Allow changing metrics reporting state without callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix func name Created 4 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 unified diff | Download patch
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/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #import "base/mac/scoped_nsobject.h" 8 #import "base/mac/scoped_nsobject.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (!IsMetricsReportingPolicyManaged()) { 68 if (!IsMetricsReportingPolicyManaged()) {
69 base::scoped_nsobject<FirstRunDialogController> dialog( 69 base::scoped_nsobject<FirstRunDialogController> dialog(
70 [[FirstRunDialogController alloc] init]); 70 [[FirstRunDialogController alloc] init]);
71 71
72 [dialog.get() showWindow:nil]; 72 [dialog.get() showWindow:nil];
73 dialog_shown = true; 73 dialog_shown = true;
74 74
75 // If the dialog asked the user to opt-in for stats and crash reporting, 75 // If the dialog asked the user to opt-in for stats and crash reporting,
76 // record the decision and enable the crash reporter if appropriate. 76 // record the decision and enable the crash reporter if appropriate.
77 bool consent_given = [dialog.get() statsEnabled]; 77 bool consent_given = [dialog.get() statsEnabled];
78 InitiateMetricsReportingChange(consent_given, 78 ChangeMetricsReportingState(consent_given);
79 OnMetricsReportingCallbackType());
80 79
81 // If selected set as default browser. 80 // If selected set as default browser.
82 BOOL make_default_browser = [dialog.get() makeDefaultBrowser]; 81 BOOL make_default_browser = [dialog.get() makeDefaultBrowser];
83 if (make_default_browser) { 82 if (make_default_browser) {
84 bool success = shell_integration::SetAsDefaultBrowser(); 83 bool success = shell_integration::SetAsDefaultBrowser();
85 DCHECK(success); 84 DCHECK(success);
86 } 85 }
87 } 86 }
88 #else // GOOGLE_CHROME_BUILD 87 #else // GOOGLE_CHROME_BUILD
89 // We don't show the dialog in Chromium. 88 // We don't show the dialog in Chromium.
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 [NSApp stopModal]; 263 [NSApp stopModal];
265 } 264 }
266 265
267 - (IBAction)learnMore:(id)sender { 266 - (IBAction)learnMore:(id)sender {
268 NSString* urlStr = base::SysUTF8ToNSString(chrome::kLearnMoreReportingURL); 267 NSString* urlStr = base::SysUTF8ToNSString(chrome::kLearnMoreReportingURL);
269 NSURL* learnMoreUrl = [NSURL URLWithString:urlStr]; 268 NSURL* learnMoreUrl = [NSURL URLWithString:urlStr];
270 [[NSWorkspace sharedWorkspace] openURL:learnMoreUrl]; 269 [[NSWorkspace sharedWorkspace] openURL:learnMoreUrl];
271 } 270 }
272 271
273 @end 272 @end
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_reporting_state.cc ('k') | chrome/browser/ui/views/first_run_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698