| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_VIEWS_FIRST_RUN_VIEW_H_ | |
| 6 #define CHROME_BROWSER_VIEWS_FIRST_RUN_VIEW_H_ | |
| 7 | |
| 8 #include "chrome/browser/views/first_run_view_base.h" | |
| 9 #include "chrome/browser/views/first_run_customize_view.h" | |
| 10 #include "chrome/browser/views/first_run_search_engine_view.h" | |
| 11 #include "views/controls/link.h" | |
| 12 #include "views/view.h" | |
| 13 #include "views/window/dialog_delegate.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class Label; | |
| 17 class Window; | |
| 18 } | |
| 19 | |
| 20 class Profile; | |
| 21 class ImporterHost; | |
| 22 class TemplateURL; | |
| 23 | |
| 24 // FirstRunView implements the dialog that welcomes to user to Chrome after | |
| 25 // a fresh install. | |
| 26 class FirstRunView : public FirstRunViewBase, | |
| 27 public views::LinkController, | |
| 28 public FirstRunCustomizeView::CustomizeViewObserver, | |
| 29 public SearchEngineSelectionObserver { | |
| 30 public: | |
| 31 explicit FirstRunView(Profile* profile, bool homepage_defined, | |
| 32 int import_items, int dont_import_items, | |
| 33 bool search_engine_experiment, | |
| 34 bool randomize_search_engine_experiment); | |
| 35 virtual ~FirstRunView(); | |
| 36 | |
| 37 bool accepted() const { return accepted_;} | |
| 38 | |
| 39 // Overridden from views::View: | |
| 40 virtual gfx::Size GetPreferredSize(); | |
| 41 virtual void Layout(); | |
| 42 | |
| 43 // Overridden from views::DialogDelegate: | |
| 44 virtual bool Accept(); | |
| 45 virtual bool Cancel(); | |
| 46 | |
| 47 // Overridden from views::WindowDelegate: | |
| 48 virtual std::wstring GetWindowTitle() const; | |
| 49 virtual views::View* GetContentsView(); | |
| 50 | |
| 51 // Overridden from views::LinkActivated: | |
| 52 virtual void LinkActivated(views::Link* source, int event_flags); | |
| 53 | |
| 54 // Overridden from FirstRunCustomizeView: | |
| 55 virtual void CustomizeAccepted(); | |
| 56 virtual void CustomizeCanceled(); | |
| 57 | |
| 58 // Overridden from SearchEngineSelectionObserver: | |
| 59 virtual void SearchEngineChosen(const TemplateURL* default_search); | |
| 60 | |
| 61 private: | |
| 62 // Initializes the controls on the dialog. | |
| 63 void SetupControls(); | |
| 64 | |
| 65 // Creates the dialog that allows the user to customize work items. | |
| 66 void OpenCustomizeDialog(); | |
| 67 | |
| 68 // Creates the search engine selection dialog. If |randomize|, the display | |
| 69 // of search engine logos should be randomized. | |
| 70 void OpenSearchEngineDialog(bool randomize); | |
| 71 | |
| 72 views::Label* welcome_label_; | |
| 73 views::Label* actions_label_; | |
| 74 views::Label* actions_import_; | |
| 75 views::Label* actions_shorcuts_; | |
| 76 views::Link* customize_link_; | |
| 77 bool customize_selected_; | |
| 78 | |
| 79 // Whether the user accepted (pressed the "Start" button as opposed to | |
| 80 // "Cancel"). | |
| 81 bool accepted_; | |
| 82 | |
| 83 DISALLOW_COPY_AND_ASSIGN(FirstRunView); | |
| 84 }; | |
| 85 | |
| 86 #endif // CHROME_BROWSER_VIEWS_FIRST_RUN_VIEW_H_ | |
| OLD | NEW |