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

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: review Created 7 years, 7 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..4c5933a53eeec08aa743668d7b3fdf5b24983180 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,21 +86,21 @@ bool FirstRunDialog::Show() {
!metrics_reporting_pref->IsManaged();
if (!show_reporting_dialog)
- return true; // Nothing to do
+ return; // Nothing to do
jeremy 2013/05/06 17:59:38 Does this compile?
gab 2013/05/06 18:44:51 Whoops, you're right :) -- I'm on Windows! Cleaned
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));
// but that spins a nested message loop and hoses us. :(
// http://code.google.com/p/chromium/issues/detail?id=12552
- // Instead, run a loop and extract the response manually.
+ // Instead, run a loop directly here.
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