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

Unified Diff: chrome/browser/ui/gtk/first_run_dialog.cc

Issue 14946003: Record first run startup metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/ui/gtk/first_run_dialog.cc
diff --git a/chrome/browser/ui/gtk/first_run_dialog.cc b/chrome/browser/ui/gtk/first_run_dialog.cc
index aa4b7800490a609fe1f73c798dbefaf47cc8ff3b..37896b0f3f4a9d56742ade597628ac8e1cd383e7 100644
--- a/chrome/browser/ui/gtk/first_run_dialog.cc
+++ b/chrome/browser/ui/gtk/first_run_dialog.cc
@@ -68,17 +68,16 @@ void SetWelcomePosition(GtkFloatingContainer* container,
namespace first_run {
-void ShowFirstRunDialog(Profile* profile) {
- FirstRunDialog::Show();
+bool ShowFirstRunDialog(Profile* profile) {
+ return FirstRunDialog::Show();
}
} // namespace first_run
// static
bool FirstRunDialog::Show() {
-#if !defined(GOOGLE_CHROME_BUILD)
- return true; // Nothing to do
-#else
+ bool dialog_shown = false;
+#if defined(GOOGLE_CHROME_BUILD)
// If the metrics reporting is managed, we won't ask.
const PrefService::Preference* metrics_reporting_pref =
g_browser_process->local_state()->FindPreference(
@@ -87,11 +86,12 @@ bool FirstRunDialog::Show() {
!metrics_reporting_pref->IsManaged();
if (!show_reporting_dialog)
- return true; // Nothing to do
+ return; // Nothing to do
int response = -1;
// Object deletes itself.
new FirstRunDialog(show_reporting_dialog, &response);
+ dialog_shown = true;
// TODO(port): it should be sufficient to just run the dialog:
// int response = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -99,9 +99,8 @@ bool FirstRunDialog::Show() {
// http://code.google.com/p/chromium/issues/detail?id=12552
// Instead, run a loop and extract the response manually.
MessageLoop::current()->Run();
-
- return (response == GTK_RESPONSE_ACCEPT);
#endif // defined(GOOGLE_CHROME_BUILD)
+ return dialog_shown;
}
FirstRunDialog::FirstRunDialog(bool show_reporting_dialog, int* response)

Powered by Google App Engine
This is Rietveld 408576698