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

Side by Side Diff: chrome/browser/first_run/first_run_internal_posix.cc

Issue 2014353002: Make Mac and Linux first run dialogs use metrics APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment. Created 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/first_run_dialog.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/first_run/first_run_internal.h" 5 #include "chrome/browser/first_run/first_run_internal.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 19 matching lines...) Expand all
30 bool local_state_file_exists = base::PathExists(local_state_path); 30 bool local_state_file_exists = base::PathExists(local_state_path);
31 // Launch the first run dialog only for certain builds, and only if the user 31 // Launch the first run dialog only for certain builds, and only if the user
32 // has not already set preferences. 32 // has not already set preferences.
33 if (internal::IsOrganicFirstRun() && !local_state_file_exists) { 33 if (internal::IsOrganicFirstRun() && !local_state_file_exists) {
34 if (ShowFirstRunDialog(profile)) { 34 if (ShowFirstRunDialog(profile)) {
35 RecordMetricsReportingDefaultOptIn(g_browser_process->local_state(), 35 RecordMetricsReportingDefaultOptIn(g_browser_process->local_state(),
36 first_run::IsMetricsReportingOptIn()); 36 first_run::IsMetricsReportingOptIn());
37 startup_metric_utils::SetNonBrowserUIDisplayed(); 37 startup_metric_utils::SetNonBrowserUIDisplayed();
38 } 38 }
39 } 39 }
40
41 // If stats reporting was turned on by the first run dialog then toggle
42 // the pref (on Windows, the download is tagged with enable/disable stats so
43 // this is POSIX-specific).
44 if (GoogleUpdateSettings::GetCollectStatsConsent()) {
45 g_browser_process->local_state()->SetBoolean(
46 metrics::prefs::kMetricsReportingEnabled, true);
47 }
48 #endif 40 #endif
49 } 41 }
50 42
51 bool IsFirstRunSentinelPresent() { 43 bool IsFirstRunSentinelPresent() {
52 base::FilePath sentinel; 44 base::FilePath sentinel;
53 return !GetFirstRunSentinelFilePath(&sentinel) || base::PathExists(sentinel); 45 return !GetFirstRunSentinelFilePath(&sentinel) || base::PathExists(sentinel);
54 } 46 }
55 47
56 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) { 48 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) {
57 // The EULA is only handled on Windows. 49 // The EULA is only handled on Windows.
58 return true; 50 return true;
59 } 51 }
60 52
61 } // namespace internal 53 } // namespace internal
62 } // namespace first_run 54 } // namespace first_run
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/first_run_dialog.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698