| 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_CUSTOMIZE_VIEW_H_ | |
| 6 #define CHROME_BROWSER_VIEWS_FIRST_RUN_CUSTOMIZE_VIEW_H_ | |
| 7 | |
| 8 #include "app/combobox_model.h" | |
| 9 #include "chrome/browser/views/first_run_view_base.h" | |
| 10 #include "views/controls/button/button.h" | |
| 11 #include "views/controls/combobox/combobox.h" | |
| 12 #include "views/view.h" | |
| 13 #include "views/window/dialog_delegate.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class Checkbox; | |
| 17 class ComboBox; | |
| 18 class ImageView; | |
| 19 class Label; | |
| 20 class Separator; | |
| 21 class Window; | |
| 22 } | |
| 23 | |
| 24 class Profile; | |
| 25 | |
| 26 // FirstRunCustomizeView implements the dialog that allows the user to do | |
| 27 // some simple customizations during the first run. | |
| 28 class FirstRunCustomizeView : public FirstRunViewBase, | |
| 29 public ComboboxModel { | |
| 30 public: | |
| 31 class CustomizeViewObserver { | |
| 32 public: | |
| 33 // Called when the user has accepted the dialog. | |
| 34 virtual void CustomizeAccepted() = 0; | |
| 35 // Called when the user has canceled the dialog. | |
| 36 virtual void CustomizeCanceled() = 0; | |
| 37 }; | |
| 38 | |
| 39 FirstRunCustomizeView(Profile* profile, | |
| 40 ImporterHost* importer_host, | |
| 41 CustomizeViewObserver* observer, | |
| 42 bool default_browser_checked, | |
| 43 bool homepage_defined, | |
| 44 int import_items, | |
| 45 int dont_import_items, | |
| 46 bool randomize_search_engine_experiment, | |
| 47 bool search_engine_experiment); | |
| 48 virtual ~FirstRunCustomizeView(); | |
| 49 | |
| 50 // Overridden from views::View. | |
| 51 virtual gfx::Size GetPreferredSize(); | |
| 52 virtual void Layout(); | |
| 53 | |
| 54 // Overridden from views::DialogDelegate. | |
| 55 virtual bool Accept(); | |
| 56 virtual bool Cancel(); | |
| 57 | |
| 58 // Overridden form FirstRunViewBase. | |
| 59 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | |
| 60 | |
| 61 // Overridden form ComboboxModel. | |
| 62 virtual int GetItemCount(); | |
| 63 virtual std::wstring GetItemAt(int index); | |
| 64 | |
| 65 // Overridden from views::WindowDelegate. | |
| 66 virtual std::wstring GetWindowTitle() const; | |
| 67 virtual views::View* GetContentsView(); | |
| 68 // Yes, we're modal. | |
| 69 // NOTE: if you change this you'll need to make sure it isn't possible to | |
| 70 // close the window while importing. | |
| 71 virtual bool IsModal() const { return true; } | |
| 72 | |
| 73 private: | |
| 74 // Initializes the controls on the dialog. | |
| 75 void SetupControls(); | |
| 76 | |
| 77 views::Checkbox* MakeCheckBox(int resource_id); | |
| 78 | |
| 79 views::Label* main_label_; | |
| 80 views::Checkbox* import_cbox_; | |
| 81 views::Combobox* import_from_combo_; | |
| 82 views::Label* shortcuts_label_; | |
| 83 views::Checkbox* desktop_shortcut_cbox_; | |
| 84 views::Checkbox* quick_shortcut_cbox_; | |
| 85 | |
| 86 CustomizeViewObserver* customize_observer_; | |
| 87 | |
| 88 DISALLOW_COPY_AND_ASSIGN(FirstRunCustomizeView); | |
| 89 }; | |
| 90 | |
| 91 #endif // CHROME_BROWSER_VIEWS_FIRST_RUN_CUSTOMIZE_VIEW_H_ | |
| OLD | NEW |