| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_WEBUI_SETTINGS_SETTINGS_PAGE_UI_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_PAGE_UI_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_PAGE_UI_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_PAGE_UI_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 void ResolveJavascriptCallback(const base::Value& callback_id, | 24 void ResolveJavascriptCallback(const base::Value& callback_id, |
| 25 const base::Value& response); | 25 const base::Value& response); |
| 26 | 26 |
| 27 // Helper method for responding to JS requests initiated with | 27 // Helper method for responding to JS requests initiated with |
| 28 // cr.sendWithPromise(), for the case where the returned promise should be | 28 // cr.sendWithPromise(), for the case where the returned promise should be |
| 29 // rejected (request failed). | 29 // rejected (request failed). |
| 30 void RejectJavascriptCallback(const base::Value& callback_id, | 30 void RejectJavascriptCallback(const base::Value& callback_id, |
| 31 const base::Value& response); | 31 const base::Value& response); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // SettingsPageUIHandler subclasses must be JavaScript-lifecycle safe. |
| 35 void OnJavascriptAllowed() override = 0; |
| 36 void OnJavascriptDisallowed() override = 0; |
| 37 |
| 34 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); | 38 DISALLOW_COPY_AND_ASSIGN(SettingsPageUIHandler); |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 } // namespace settings | 41 } // namespace settings |
| 38 | 42 |
| 39 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_PAGE_UI_HANDLER_H_ | 43 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_PAGE_UI_HANDLER_H_ |
| OLD | NEW |