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