| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_ |
| 7 | 7 |
| 8 typedef struct _GtkButton GtkButton; | 8 typedef struct _GtkButton GtkButton; |
| 9 typedef struct _GtkWidget GtkWidget; | 9 typedef struct _GtkWidget GtkWidget; |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/first_run/first_run.h" | 12 #include "chrome/browser/first_run/first_run.h" |
| 13 #include "ui/base/gtk/gtk_signal.h" | 13 #include "ui/base/gtk/gtk_signal.h" |
| 14 | 14 |
| 15 class FirstRunDialog { | 15 class FirstRunDialog { |
| 16 public: | 16 public: |
| 17 // Displays the first run UI for reporting opt-in, import data etc. | 17 // Displays the first run UI for reporting opt-in, import data etc. |
| 18 // Returns true if the dialog was shown. | 18 // Returns true if the dialog was shown. |
| 19 static bool Show(); | 19 static bool Show(Profile* profile); |
| 20 | 20 |
| 21 private: | 21 private: |
| 22 FirstRunDialog(); | 22 explicit FirstRunDialog(Profile* profile); |
| 23 virtual ~FirstRunDialog(); | 23 virtual ~FirstRunDialog(); |
| 24 | 24 |
| 25 CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int); | 25 CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int); |
| 26 CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*); | 26 CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*); |
| 27 | 27 |
| 28 void ShowReportingDialog(); | 28 void ShowReportingDialog(); |
| 29 | 29 |
| 30 // This method closes the first run window and quits the message loop so that | 30 // This method closes the first run window and quits the message loop so that |
| 31 // the Chrome startup can continue. This should be called when all the | 31 // the Chrome startup can continue. This should be called when all the |
| 32 // first run tasks are done. | 32 // first run tasks are done. |
| 33 void FirstRunDone(); | 33 void FirstRunDone(); |
| 34 | 34 |
| 35 Profile* profile_; |
| 36 |
| 35 // Dialog that holds the bug reporting and default browser checkboxes. | 37 // Dialog that holds the bug reporting and default browser checkboxes. |
| 36 GtkWidget* dialog_; | 38 GtkWidget* dialog_; |
| 37 | 39 |
| 38 // Crash reporting checkbox | 40 // Crash reporting checkbox |
| 39 GtkWidget* report_crashes_; | 41 GtkWidget* report_crashes_; |
| 40 | 42 |
| 41 // Make browser default checkbox | 43 // Make browser default checkbox |
| 42 GtkWidget* make_default_; | 44 GtkWidget* make_default_; |
| 43 | 45 |
| 44 // Whether we should show the dialog asking the user whether to report | 46 // Whether we should show the dialog asking the user whether to report |
| 45 // crashes and usage stats. | 47 // crashes and usage stats. |
| 46 bool show_reporting_dialog_; | 48 bool show_reporting_dialog_; |
| 47 | 49 |
| 48 // User response (accept or cancel) is returned through this. | 50 // User response (accept or cancel) is returned through this. |
| 49 int* response_; | 51 int* response_; |
| 50 | 52 |
| 51 DISALLOW_COPY_AND_ASSIGN(FirstRunDialog); | 53 DISALLOW_COPY_AND_ASSIGN(FirstRunDialog); |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 #endif // CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_ | 56 #endif // CHROME_BROWSER_UI_GTK_FIRST_RUN_DIALOG_H_ |
| OLD | NEW |