| 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 22 matching lines...) Expand all Loading... |
| 33 static void ShowSettingsResetPrompt( | 33 static void ShowSettingsResetPrompt( |
| 34 Browser* browser, | 34 Browser* browser, |
| 35 SettingsResetPromptController* controller); | 35 SettingsResetPromptController* controller); |
| 36 | 36 |
| 37 base::string16 GetWindowTitle() const; | 37 base::string16 GetWindowTitle() const; |
| 38 base::string16 GetButtonLabel() const; | 38 base::string16 GetButtonLabel() const; |
| 39 base::string16 GetMainText() const; | 39 base::string16 GetMainText() const; |
| 40 // Returns the offset into the main text string where a URL was inserted. To | 40 // Returns the offset into the main text string where a URL was inserted. To |
| 41 // be used by the dialog to apply an appropriate style to the URL text. | 41 // be used by the dialog to apply an appropriate style to the URL text. |
| 42 gfx::Range GetMainTextUrlRange() const; | 42 gfx::Range GetMainTextUrlRange() const; |
| 43 // |DialogShown()| will be called by the dialog when the dialog's |Show()| |
| 44 // method is called. This allows the controller to notify the model that the |
| 45 // dialog has been shown so that preferences can be updated. |
| 46 void DialogShown(); |
| 43 // |Accept()| will be called by the dialog when the user clicks the main | 47 // |Accept()| will be called by the dialog when the user clicks the main |
| 44 // button, after which the dialog will be closed. | 48 // button, after which the dialog will be closed. |
| 45 void Accept(); | 49 void Accept(); |
| 46 // |Cancel()| will be called by the dialog when the user clicks the dismiss | 50 // |Cancel()| will be called by the dialog when the user clicks the dismiss |
| 47 // button on the top right, after which the dialog will be closed. | 51 // button on the top right, after which the dialog will be closed. |
| 48 void Cancel(); | 52 void Cancel(); |
| 49 | 53 |
| 50 private: | 54 private: |
| 51 ~SettingsResetPromptController(); | 55 ~SettingsResetPromptController(); |
| 52 void InitMainText(); | 56 void InitMainText(); |
| 53 // Function to be called sometime after |Accept()| or |Cancel()| has been | 57 // Function to be called sometime after |Accept()| or |Cancel()| has been |
| 54 // called to perform any final tasks (such as metrcis reporting) and delete | 58 // called to perform any final tasks (such as metrcis reporting) and delete |
| 55 // this object. | 59 // this object. |
| 56 void OnInteractionDone(); | 60 void OnInteractionDone(); |
| 57 | 61 |
| 58 std::unique_ptr<SettingsResetPromptModel> model_; | 62 std::unique_ptr<SettingsResetPromptModel> model_; |
| 59 base::string16 main_text_; | 63 base::string16 main_text_; |
| 60 gfx::Range main_text_url_range_; | 64 gfx::Range main_text_url_range_; |
| 61 | 65 |
| 62 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptController); | 66 DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptController); |
| 63 }; | 67 }; |
| 64 | 68 |
| 69 // Function to be called after startup in order to display the settings reset |
| 70 // prompt. The function will figure out if a prompt is needed, and if so, show |
| 71 // the dialog after a delay as determined by the |kSettingsResetPrompt| |
| 72 // feature parameters. |
| 73 void MaybeShowSettingsResetPromptWithDelay(); |
| 74 |
| 65 } // namespace safe_browsing | 75 } // namespace safe_browsing |
| 66 | 76 |
| 67 #endif // CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PRO
MPT_CONTROLLER_H_ | 77 #endif // CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PRO
MPT_CONTROLLER_H_ |
| OLD | NEW |