Commit c75c498b authored by estade@chromium.org's avatar estade@chromium.org

New first run experience for Linux.

We first show a search engine choice dialog (basically matches windows) but also (in the google chrome case) show a second dialog with the "make chrome the default browser" and "report crashes?" checkboxes. In the chromium case, we don't show the second dialog because it would have a single checkbox (no crash reporting in chromium), and that checkbox is covered by an infobar anyway.

In Chrome, the search engines have image logos. In chromium, they only have plain text logos.

We also no longer show the first run bubble.

BUG=49705
TEST=manual (Chrome and Chromium)

TODO:
- skip the search engine choice when there are no suggested search engines
- show the default search if it's not in the first 3 search engines list
- randomize the search engines list (sometimes)
- remove first run bubble code

Review URL: http://codereview.chromium.org/3106031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57109 0039d316-1c4b-4281-b951-d872f2087c98
parent 74d75e0b
This diff is collapsed.
...@@ -12,50 +12,65 @@ typedef struct _GtkWidget GtkWidget; ...@@ -12,50 +12,65 @@ typedef struct _GtkWidget GtkWidget;
#include "app/gtk_signal.h" #include "app/gtk_signal.h"
#include "chrome/browser/first_run/first_run.h" #include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/importer/importer.h" #include "chrome/browser/importer/importer.h"
#include "chrome/browser/search_engines/template_url_model.h"
class FirstRunDialog : public ImportObserver { class FirstRunDialog : public ImporterHost::Observer,
public TemplateURLModelObserver {
public: public:
// Displays the first run UI for reporting opt-in, import data etc. // Displays the first run UI for reporting opt-in, import data etc.
static bool Show(Profile* profile, ProcessSingleton* process_singleton); static bool Show(Profile* profile, ProcessSingleton* process_singleton);
// Overridden from ImportObserver: // Overridden from ImporterHost::Observer ------------------------------------
virtual void ImportCanceled() { virtual void ImportEnded();
FirstRunDone(); virtual void ImportStarted() {}
} virtual void ImportItemStarted(importer::ImportItem item) {}
virtual void ImportComplete() { virtual void ImportItemEnded(importer::ImportItem item) {}
FirstRunDone();
} virtual void OnTemplateURLModelChanged();
private: private:
FirstRunDialog(Profile* profile, int& response); FirstRunDialog(Profile* profile, int& response);
~FirstRunDialog() {} virtual ~FirstRunDialog();
CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int); CHROMEGTK_CALLBACK_1(FirstRunDialog, void, OnResponseDialog, int);
CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineButtonClicked);
CHROMEGTK_CALLBACK_0(FirstRunDialog, void, OnSearchEngineWindowDestroy);
CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*); CHROMEG_CALLBACK_0(FirstRunDialog, void, OnLearnMoreLinkClicked, GtkButton*);
void ShowSearchEngineWindow();
void ShowDialog();
// This method closes the first run window and quits the message loop so that // This method closes the first run window and quits the message loop so that
// the Chrome startup can continue. This should be called when all the // the Chrome startup can continue. This should be called when all the
// first run tasks are done. // first run tasks are done.
void FirstRunDone(); void FirstRunDone();
// First Run UI Dialog // The search engine choice window. This is created and shown before
// |dialog_|.
GtkWidget* search_engine_window_;
// Dialog that holds the bug reporting and default browser checkboxes.
GtkWidget* dialog_; GtkWidget* dialog_;
// Container for the search engine choices.
GtkWidget* search_engine_hbox_;
// Crash reporting checkbox // Crash reporting checkbox
GtkWidget* report_crashes_; GtkWidget* report_crashes_;
// Make browser default checkbox // Make browser default checkbox
GtkWidget* make_default_; GtkWidget* make_default_;
// Import data checkbox
GtkWidget* import_data_;
// Combo box that displays list of profiles from which we can import.
GtkWidget* import_profile_;
// Our current profile // Our current profile
Profile* profile_; Profile* profile_;
// Owned by the profile_.
TemplateURLModel* search_engines_model_;
// The search engine the user chose, or NULL if the user has not chosen a
// search engine.
TemplateURL* chosen_search_engine_;
// User response (accept or cancel) is returned through this. // User response (accept or cancel) is returned through this.
int& response_; int& response_;
......
...@@ -192,7 +192,7 @@ static void gtk_floating_container_forall(GtkContainer* container, ...@@ -192,7 +192,7 @@ static void gtk_floating_container_forall(GtkContainer* container,
static void gtk_floating_container_size_request(GtkWidget* widget, static void gtk_floating_container_size_request(GtkWidget* widget,
GtkRequisition* requisition) { GtkRequisition* requisition) {
GtkBin *bin = GTK_BIN(widget); GtkBin* bin = GTK_BIN(widget);
if (bin && bin->child) { if (bin && bin->child) {
gtk_widget_size_request(bin->child, requisition); gtk_widget_size_request(bin->child, requisition);
} else { } else {
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
// signature: // signature:
// //
// void (*set_floating_position)(GtkFloatingContainer* container, // void (*set_floating_position)(GtkFloatingContainer* container,
// GtkAllocation* allocation); // GtkAllocation* allocation,
// gpointer userdata);
// //
// Your handler should, for each floating widget, set the "x" and "y" child // Your handler should, for each floating widget, set the "x" and "y" child
// properties. // properties.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment