| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CHROME_CLEANER_DIALOG_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CHROME_CLEANER_DIALOG_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_CHROME_CLEANER_DIALOG_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CHROME_CLEANER_DIALOG_WIN_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
| 12 #include "ui/views/window/dialog_delegate.h" | 12 #include "ui/views/window/dialog_delegate.h" |
| 13 | 13 |
| 14 class Browser; | 14 class Browser; |
| 15 | 15 |
| 16 namespace safe_browsing { | 16 namespace safe_browsing { |
| 17 class ChromeCleanerDialogController; | 17 class ChromeCleanerDialogController; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace views { |
| 21 class Checkbox; |
| 22 class LabelButton; |
| 23 } // namespace views |
| 24 |
| 20 // A modal dialog asking the user if they want to remove harmful software from | 25 // A modal dialog asking the user if they want to remove harmful software from |
| 21 // their computers by running the Chrome Cleanup tool. | 26 // their computers by running the Chrome Cleanup tool. |
| 22 // | 27 // |
| 23 // The strings and icons used in the dialog are provided by a | 28 // The strings and icons used in the dialog are provided by a |
| 24 // |ChromeCleanerDialogController| object, which will also receive information | 29 // |ChromeCleanerDialogController| object, which will also receive information |
| 25 // about how the user interacts with the dialog. The controller object owns | 30 // about how the user interacts with the dialog. The controller object owns |
| 26 // itself and will delete itself once it has received information about the | 31 // itself and will delete itself once it has received information about the |
| 27 // user's interaction with the dialog. See the |ChromeCleanerDialogController| | 32 // user's interaction with the dialog. See the |ChromeCleanerDialogController| |
| 28 // class's description for more details. | 33 // class's description for more details. |
| 29 class ChromeCleanerDialog : public views::DialogDelegateView, | 34 class ChromeCleanerDialog : public views::DialogDelegateView, |
| 30 public views::ButtonListener { | 35 public views::ButtonListener { |
| 31 public: | 36 public: |
| 32 // The |controller| object manages its own lifetime and is not owned by | 37 // The |controller| object manages its own lifetime and is not owned by |
| 33 // |ChromeCleanerDialog|. See the description of the | 38 // |ChromeCleanerDialog|. See the description of the |
| 34 // |ChromeCleanerDialogController| class for details. | 39 // |ChromeCleanerDialogController| class for details. |
| 35 explicit ChromeCleanerDialog( | 40 explicit ChromeCleanerDialog( |
| 36 safe_browsing::ChromeCleanerDialogController* controller); | 41 safe_browsing::ChromeCleanerDialogController* controller); |
| 37 ~ChromeCleanerDialog() override; | 42 ~ChromeCleanerDialog() override; |
| 38 | 43 |
| 39 void Show(Browser* browser); | 44 void Show(Browser* browser); |
| 40 | 45 |
| 41 // views::WidgetDelegate overrides. | 46 // views::WidgetDelegate overrides. |
| 42 ui::ModalType GetModalType() const override; | 47 ui::ModalType GetModalType() const override; |
| 43 base::string16 GetWindowTitle() const override; | 48 base::string16 GetWindowTitle() const override; |
| 44 | 49 |
| 45 // views::DialogDelegate overrides. | 50 // views::DialogDelegate overrides. |
| 51 views::View* CreateFootnoteView() override; |
| 46 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 52 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
| 47 views::View* CreateExtraView() override; | 53 views::View* CreateExtraView() override; |
| 48 bool Accept() override; | 54 bool Accept() override; |
| 49 bool Cancel() override; | 55 bool Cancel() override; |
| 50 bool Close() override; | 56 bool Close() override; |
| 51 | 57 |
| 52 // views::View overrides. | 58 // views::View overrides. |
| 53 gfx::Size CalculatePreferredSize() const override; | 59 gfx::Size CalculatePreferredSize() const override; |
| 54 | 60 |
| 55 // views::ButtonListener overrides. | 61 // views::ButtonListener overrides. |
| 56 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 62 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 57 | 63 |
| 58 private: | 64 private: |
| 59 Browser* browser_; | 65 Browser* browser_; |
| 60 // The pointer will be set to nullptr once the controller has been notified of | 66 // The pointer will be set to nullptr once the controller has been notified of |
| 61 // user interaction since the controller can delete itself after that point. | 67 // user interaction since the controller can delete itself after that point. |
| 62 safe_browsing::ChromeCleanerDialogController* controller_; | 68 safe_browsing::ChromeCleanerDialogController* controller_; |
| 69 views::LabelButton* details_button_; |
| 70 views::Checkbox* logs_permission_checkbox_; |
| 63 | 71 |
| 64 DISALLOW_COPY_AND_ASSIGN(ChromeCleanerDialog); | 72 DISALLOW_COPY_AND_ASSIGN(ChromeCleanerDialog); |
| 65 }; | 73 }; |
| 66 | 74 |
| 67 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_CLEANER_DIALOG_WIN_H_ | 75 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_CLEANER_DIALOG_WIN_H_ |
| OLD | NEW |