| 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_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_DIALOG_CONTRO
LLER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_DIALOG_CONTRO
LLER_WIN_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_DIALOG_CONTRO
LLER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_DIALOG_CONTRO
LLER_WIN_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 | 12 |
| 13 namespace safe_browsing { | 13 namespace safe_browsing { |
| 14 | 14 |
| 15 // Provides the various elements that will be displayed in the Chrome Cleaner | 15 // Provides the various elements that will be displayed in the Chrome Cleaner |
| 16 // UI. Also provides functions, such as |Accept()| and |Cancel()|, that should | 16 // UI. Also provides functions, such as |Accept()| and |Cancel()|, that should |
| 17 // be called by the UI in response to user actions. | 17 // be called by the UI in response to user actions. |
| 18 // | 18 // |
| 19 // This class manages its own lifetime and will delete itself once the Cleaner | 19 // This class manages its own lifetime and will delete itself once the Cleaner |
| 20 // dialog has been dismissed and either of |Accept()| or |Cancel()| have been | 20 // dialog has been dismissed and either of |Accept()| or |Cancel()| have been |
| 21 // called. | 21 // called. |
| 22 class ChromeCleanerDialogController { | 22 class ChromeCleanerDialogController { |
| 23 public: | 23 public: |
| 24 ChromeCleanerDialogController(); | 24 ChromeCleanerDialogController(); |
| 25 | 25 |
| 26 base::string16 GetWindowTitle() const; | 26 base::string16 GetWindowTitle() const; |
| 27 base::string16 GetMainText() const; | 27 base::string16 GetMainText() const; |
| 28 base::string16 GetAcceptButtonLabel() const; | 28 base::string16 GetAcceptButtonLabel() const; |
| 29 base::string16 GetAdvancedButtonLabel() const; | 29 base::string16 GetDetailsButtonLabel() const; |
| 30 | 30 |
| 31 // Called by the Cleaner dialog when the dialog has been shown. Used for | 31 // Called by the Cleaner dialog when the dialog has been shown. Used for |
| 32 // reporting metrics. | 32 // reporting metrics. |
| 33 void DialogShown(); | 33 void DialogShown(); |
| 34 // Called by the Cleaner dialog when user accepts the prompt. Once |Accept()| | 34 // Called by the Cleaner dialog when user accepts the prompt. Once |Accept()| |
| 35 // has been called, the controller will eventually delete itself and no member | 35 // has been called, the controller will eventually delete itself and no member |
| 36 // functions should be called after that. | 36 // functions should be called after that. |
| 37 void Accept(); | 37 void Accept(); |
| 38 // Called by the Cleaner dialog when the dialog is closed via the cancel | 38 // Called by the Cleaner dialog when the dialog is closed via the cancel |
| 39 // button. Once |Cancel()| has been called, the controller will eventually | 39 // button. Once |Cancel()| has been called, the controller will eventually |
| 40 // delete itself and no member functions should be called after that. | 40 // delete itself and no member functions should be called after that. |
| 41 void Cancel(); | 41 void Cancel(); |
| 42 // Called by the Cleaner dialog when the dialog is closed by some other means | 42 // Called by the Cleaner dialog when the dialog is closed by some other means |
| 43 // than the cancel button (for example, by pressing Esc or clicking the 'x' on | 43 // than the cancel button (for example, by pressing Esc or clicking the 'x' on |
| 44 // the top of the dialog). After a call to |Dismiss()|, the controller will | 44 // the top of the dialog). After a call to |Dismiss()|, the controller will |
| 45 // eventually delete itself and no member functions should be called after | 45 // eventually delete itself and no member functions should be called after |
| 46 // that. | 46 // that. |
| 47 void Close(); | 47 void Close(); |
| 48 // Called when the advanced button is clicked, after which the dialog will | 48 // Called when the details button is clicked, after which the dialog will |
| 49 // close. After a call to |AdvancedButtonClicked()|, the controller will | 49 // close. After a call to |DetailsButtonClicked()|, the controller will |
| 50 // eventually delete itself and no member functions should be called after | 50 // eventually delete itself and no member functions should be called after |
| 51 // that. | 51 // that. |
| 52 void AdvancedButtonClicked(); | 52 void DetailsButtonClicked(); |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 ~ChromeCleanerDialogController(); | 55 ~ChromeCleanerDialogController(); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 void OnInteractionDone(); | 58 void OnInteractionDone(); |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(ChromeCleanerDialogController); | 60 DISALLOW_COPY_AND_ASSIGN(ChromeCleanerDialogController); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace safe_browsing | 63 } // namespace safe_browsing |
| 64 | 64 |
| 65 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_DIALOG_CON
TROLLER_H_ | 65 #endif // CHROME_BROWSER_SAFE_BROWSING_CHROME_CLEANER_CHROME_CLEANER_DIALOG_CON
TROLLER_WIN_H_ |
| OLD | NEW |