| 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_PROTOCOL_HANDLERS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 void OnJavascriptAllowed() override; | 37 void OnJavascriptAllowed() override; |
| 38 void OnJavascriptDisallowed() override; | 38 void OnJavascriptDisallowed() override; |
| 39 void RegisterMessages() override; | 39 void RegisterMessages() override; |
| 40 | 40 |
| 41 // content::NotificationObserver: | 41 // content::NotificationObserver: |
| 42 void Observe(int type, | 42 void Observe(int type, |
| 43 const content::NotificationSource& source, | 43 const content::NotificationSource& source, |
| 44 const content::NotificationDetails& details) override; | 44 const content::NotificationDetails& details) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Called to fetch the initial list of data to show. | 47 // Called to fetch the state of the protocol handlers. If the full list of |
| 48 void HandleInitializeList(const base::ListValue* args); | 48 // handlers is not needed, consider HandleObserveProtocolHandlersEnabledState |
| 49 // instead. |
| 50 void HandleObserveProtocolHandlers(const base::ListValue* args); |
| 51 |
| 52 // Called to begin updates to the handlers enabled status. This is a subset |
| 53 // (lighter alternative) of HandleObserveProtocolHandlers. There's no need to |
| 54 // call this function if HandleObserveProtocolHandlers is called. |
| 55 void HandleObserveProtocolHandlersEnabledState(const base::ListValue* args); |
| 49 | 56 |
| 50 // Notifies the JS side whether the handlers are enabled or not. | 57 // Notifies the JS side whether the handlers are enabled or not. |
| 51 void SendHandlersEnabledValue(); | 58 void SendHandlersEnabledValue(); |
| 52 | 59 |
| 53 // Called when the user toggles whether custom handlers are enabled. | 60 // Called when the user toggles whether custom handlers are enabled. |
| 54 void HandleSetHandlersEnabled(const base::ListValue* args); | 61 void HandleSetHandlersEnabled(const base::ListValue* args); |
| 55 | 62 |
| 56 // Called when the user sets a new default handler for a protocol. | 63 // Called when the user sets a new default handler for a protocol. |
| 57 void HandleSetDefault(const base::ListValue* args); | 64 void HandleSetDefault(const base::ListValue* args); |
| 58 | 65 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 86 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 93 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
| 87 | 94 |
| 88 content::NotificationRegistrar notification_registrar_; | 95 content::NotificationRegistrar notification_registrar_; |
| 89 | 96 |
| 90 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlersHandler); | 97 DISALLOW_COPY_AND_ASSIGN(ProtocolHandlersHandler); |
| 91 }; | 98 }; |
| 92 | 99 |
| 93 } // namespace settings | 100 } // namespace settings |
| 94 | 101 |
| 95 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_ | 102 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PROTOCOL_HANDLERS_HANDLER_H_ |
| OLD | NEW |