| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_VIEWS_FIRST_RUN_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "ui/views/controls/link_listener.h" | 9 #include "ui/views/controls/link_listener.h" |
| 10 #include "ui/views/window/dialog_delegate.h" | 10 #include "ui/views/window/dialog_delegate.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace views { | 14 namespace views { |
| 15 class Checkbox; | 15 class Checkbox; |
| 16 class Link; | 16 class Link; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class FirstRunDialog : public views::DialogDelegateView, | 19 class FirstRunDialog : public views::DialogDelegateView, |
| 20 public views::LinkListener { | 20 public views::LinkListener { |
| 21 public: | 21 public: |
| 22 // Displays the first run UI for reporting opt-in, import data etc. | 22 // Displays the first run UI for reporting opt-in, import data etc. |
| 23 // Returns true if the dialog was shown. | 23 // Returns true if the dialog was shown. |
| 24 static bool Show(Profile* profile); | 24 static bool Show(Profile* profile); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 explicit FirstRunDialog(Profile* profile); | 27 explicit FirstRunDialog(Profile* profile); |
| 28 virtual ~FirstRunDialog(); | 28 ~FirstRunDialog() override; |
| 29 | 29 |
| 30 // This terminates the nested message-loop. | 30 // This terminates the nested message-loop. |
| 31 void Done(); | 31 void Done(); |
| 32 | 32 |
| 33 // views::DialogDelegate: | 33 // views::DialogDelegate: |
| 34 virtual views::View* CreateExtraView() override; | 34 views::View* CreateExtraView() override; |
| 35 virtual void OnClosed() override; | 35 void OnClosed() override; |
| 36 virtual bool Accept() override; | 36 bool Accept() override; |
| 37 virtual int GetDialogButtons() const override; | 37 int GetDialogButtons() const override; |
| 38 | 38 |
| 39 // views::LinkListener: | 39 // views::LinkListener: |
| 40 virtual void LinkClicked(views::Link* source, int event_flags) override; | 40 void LinkClicked(views::Link* source, int event_flags) override; |
| 41 | 41 |
| 42 Profile* profile_; | 42 Profile* profile_; |
| 43 views::Checkbox* make_default_; | 43 views::Checkbox* make_default_; |
| 44 views::Checkbox* report_crashes_; | 44 views::Checkbox* report_crashes_; |
| 45 base::Closure quit_runloop_; | 45 base::Closure quit_runloop_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(FirstRunDialog); | 47 DISALLOW_COPY_AND_ASSIGN(FirstRunDialog); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 #endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_ | 50 #endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_DIALOG_H_ |
| OLD | NEW |