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_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PROMPT
_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PROMPT
_CONTROLLER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PROMPT
_CONTROLLER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PROMPT
_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // Returns the offset into the main text string where a URL was inserted. To | 41 // Returns the offset into the main text string where a URL was inserted. To |
42 // be used by the dialog to apply an appropriate style to the URL text. | 42 // be used by the dialog to apply an appropriate style to the URL text. |
43 gfx::Range GetMainTextUrlRange() const; | 43 gfx::Range GetMainTextUrlRange() const; |
44 // |DialogShown()| will be called by the dialog when the dialog's |Show()| | 44 // |DialogShown()| will be called by the dialog when the dialog's |Show()| |
45 // method is called. This allows the controller to notify the model that the | 45 // method is called. This allows the controller to notify the model that the |
46 // dialog has been shown so that preferences can be updated. | 46 // dialog has been shown so that preferences can be updated. |
47 void DialogShown(); | 47 void DialogShown(); |
48 // |Accept()| will be called by the dialog when the user clicks the main | 48 // |Accept()| will be called by the dialog when the user clicks the main |
49 // button, after which the dialog will be closed. | 49 // button, after which the dialog will be closed. |
50 void Accept(); | 50 void Accept(); |
51 // |Cancel()| will be called by the dialog when the user clicks the dismiss | 51 // |Cancel()| will be called by the dialog when the user clicks the cancel |
52 // button on the top right, after which the dialog will be closed. | 52 // button, after which the dialog will be closed. |
53 void Cancel(); | 53 void Cancel(); |
| 54 // |Close()| will be called by the dialog when the user dismisses the dialog, |
| 55 // for example by clicking the x in the top right corner or by pressing the |
| 56 // Escape key. |
| 57 void Close(); |
54 | 58 |
55 private: | 59 private: |
56 ~SettingsResetPromptController(); | 60 ~SettingsResetPromptController(); |
57 void InitMainText(); | 61 void InitMainText(); |
58 // Function to be called sometime after |Accept()| or |Cancel()| has been | 62 // Function to be called sometime after |Accept()| or |Cancel()| has been |
59 // called to perform any final tasks (such as metrcis reporting) and delete | 63 // called to perform any final tasks (such as metrcis reporting) and delete |
60 // this object. | 64 // this object. |
61 void OnInteractionDone(); | 65 void OnInteractionDone(); |
62 | 66 |
63 std::unique_ptr<SettingsResetPromptModel> model_; | 67 std::unique_ptr<SettingsResetPromptModel> model_; |
64 base::string16 main_text_; | 68 base::string16 main_text_; |
65 gfx::Range main_text_url_range_; | 69 gfx::Range main_text_url_range_; |
66 | 70 |
67 // Used for metrics reporting. | 71 // Used for metrics reporting. |
68 base::Time time_dialog_shown_; | 72 base::Time time_dialog_shown_; |
69 | 73 |
70 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptController); | 74 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptController); |
71 }; | 75 }; |
72 | 76 |
73 // Function to be called after startup in order to display the settings reset | 77 // Function to be called after startup in order to display the settings reset |
74 // prompt. The function will figure out if a prompt is needed, and if so, show | 78 // prompt. The function will figure out if a prompt is needed, and if so, show |
75 // the dialog after a delay as determined by the |kSettingsResetPrompt| | 79 // the dialog after a delay as determined by the |kSettingsResetPrompt| |
76 // feature parameters. | 80 // feature parameters. |
77 void MaybeShowSettingsResetPromptWithDelay(); | 81 void MaybeShowSettingsResetPromptWithDelay(); |
78 | 82 |
79 } // namespace safe_browsing | 83 } // namespace safe_browsing |
80 | 84 |
81 #endif // CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PRO
MPT_CONTROLLER_H_ | 85 #endif // CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PRO
MPT_CONTROLLER_H_ |
OLD | NEW |