| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GTK_FIRST_RUN_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_GTK_FIRST_RUN_DIALOG_H_ |
| 6 #define CHROME_BROWSER_GTK_FIRST_RUN_DIALOG_H_ | 6 #define CHROME_BROWSER_GTK_FIRST_RUN_DIALOG_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 typedef struct _GtkButton GtkButton; | 9 typedef struct _GtkButton GtkButton; |
| 10 typedef struct _GtkWidget GtkWidget; | 10 typedef struct _GtkWidget GtkWidget; |
| 11 | 11 |
| 12 #include "app/gtk_signal.h" | 12 #include "app/gtk_signal.h" |
| 13 #include "chrome/browser/first_run/first_run.h" | 13 #include "chrome/browser/first_run/first_run.h" |
| 14 #include "chrome/browser/search_engines/template_url_model_observer.h" | 14 #include "chrome/browser/search_engines/template_url_model_observer.h" |
| 15 | 15 |
| 16 class TemplateURL; | 16 class TemplateURL; |
| 17 class TemplateURLModel; | 17 class TemplateURLModel; |
| 18 | 18 |
| 19 class FirstRunDialog : public TemplateURLModelObserver { | 19 class FirstRunDialog : public TemplateURLModelObserver { |
| 20 public: | 20 public: |
| 21 // Displays the first run UI for reporting opt-in, import data etc. | 21 // Displays the first run UI for reporting opt-in, import data etc. |
| 22 static bool Show(Profile* profile, bool randomize_search_engine_order); | 22 static bool Show(Profile* profile, bool randomize_search_engine_order); |
| 23 | 23 |
| 24 virtual void OnTemplateURLModelChanged(); | 24 virtual void OnTemplateURLModelChanged(); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 FirstRunDialog(Profile* profile, | 27 FirstRunDialog(Profile* profile, |
| 28 bool randomize_search_engine_order, | 28 bool show_reporting_dialog, |
| 29 int& response); | 29 bool show_search_engines_dialog, |
| 30 int* response); |
| 30 virtual ~FirstRunDialog(); | 31 virtual ~FirstRunDialog(); |
| 31 | 32 |
| 32 CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int); | 33 CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int); |
| 33 CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineButtonClicked); | 34 CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineButtonClicked); |
| 34 CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineWindowDestroy); | 35 CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineWindowDestroy); |
| 35 CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*); | 36 CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*); |
| 36 | 37 |
| 37 void ShowSearchEngineWindow(); | 38 void ShowSearchEngineWindow(); |
| 38 void ShowDialog(); | 39 void ShowReportingDialog(); |
| 39 | 40 |
| 40 // This method closes the first run window and quits the message loop so that | 41 // This method closes the first run window and quits the message loop so that |
| 41 // the Chrome startup can continue. This should be called when all the | 42 // the Chrome startup can continue. This should be called when all the |
| 42 // first run tasks are done. | 43 // first run tasks are done. |
| 43 void FirstRunDone(); | 44 void FirstRunDone(); |
| 44 | 45 |
| 45 // The search engine choice window. This is created and shown before | 46 // The search engine choice window. This is created and shown before |
| 46 // |dialog_|. | 47 // |dialog_|. |
| 47 GtkWidget* search_engine_window_; | 48 GtkWidget* search_engine_window_; |
| 48 | 49 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 61 // Our current profile | 62 // Our current profile |
| 62 Profile* profile_; | 63 Profile* profile_; |
| 63 | 64 |
| 64 // Owned by the profile_. | 65 // Owned by the profile_. |
| 65 TemplateURLModel* search_engines_model_; | 66 TemplateURLModel* search_engines_model_; |
| 66 | 67 |
| 67 // The search engine the user chose, or NULL if the user has not chosen a | 68 // The search engine the user chose, or NULL if the user has not chosen a |
| 68 // search engine. | 69 // search engine. |
| 69 TemplateURL* chosen_search_engine_; | 70 TemplateURL* chosen_search_engine_; |
| 70 | 71 |
| 72 // Whether we should show the dialog asking the user whether to report |
| 73 // crashes and usage stats. |
| 74 bool show_reporting_dialog_; |
| 75 |
| 71 // User response (accept or cancel) is returned through this. | 76 // User response (accept or cancel) is returned through this. |
| 72 int& response_; | 77 int* response_; |
| 73 | 78 |
| 74 DISALLOW_COPY_AND_ASSIGN(FirstRunDialog); | 79 DISALLOW_COPY_AND_ASSIGN(FirstRunDialog); |
| 75 }; | 80 }; |
| 76 | 81 |
| 77 #endif // CHROME_BROWSER_GTK_FIRST_RUN_DIALOG_H_ | 82 #endif // CHROME_BROWSER_GTK_FIRST_RUN_DIALOG_H_ |
| OLD | NEW |