| 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_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 SnippetsInternalsMessageHandler(); | 24 SnippetsInternalsMessageHandler(); |
| 25 ~SnippetsInternalsMessageHandler() override; | 25 ~SnippetsInternalsMessageHandler() override; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 // content::WebUIMessageHandler: | 28 // content::WebUIMessageHandler: |
| 29 void RegisterMessages() override; | 29 void RegisterMessages() override; |
| 30 | 30 |
| 31 // ntp_snippets::NTPSnippetsServiceObserver: | 31 // ntp_snippets::NTPSnippetsServiceObserver: |
| 32 void NTPSnippetsServiceLoaded() override; | 32 void NTPSnippetsServiceLoaded() override; |
| 33 void NTPSnippetsServiceShutdown() override; | 33 void NTPSnippetsServiceShutdown() override; |
| 34 void NTPSnippetsServiceDisabled() override; | 34 void NTPSnippetsServiceDisabledReasonChanged( |
| 35 ntp_snippets::DisabledReason disabled_reason) override; |
| 35 | 36 |
| 36 void HandleLoaded(const base::ListValue* args); | 37 void HandleLoaded(const base::ListValue* args); |
| 37 void HandleClear(const base::ListValue* args); | 38 void HandleClear(const base::ListValue* args); |
| 38 void HandleClearDiscarded(const base::ListValue* args); | 39 void HandleClearDiscarded(const base::ListValue* args); |
| 39 void HandleDownload(const base::ListValue* args); | 40 void HandleDownload(const base::ListValue* args); |
| 40 | 41 |
| 41 void SendInitialData(); | 42 void SendInitialData(); |
| 42 void SendSnippets(); | 43 void SendSnippets(); |
| 43 void SendDiscardedSnippets(); | 44 void SendDiscardedSnippets(); |
| 44 void SendHosts(); | 45 void SendHosts(); |
| 45 void SendBoolean(const std::string& name, bool value); | 46 void SendBoolean(const std::string& name, bool value); |
| 46 void SendString(const std::string& name, const std::string& value); | 47 void SendString(const std::string& name, const std::string& value); |
| 47 | 48 |
| 48 ScopedObserver<ntp_snippets::NTPSnippetsService, | 49 ScopedObserver<ntp_snippets::NTPSnippetsService, |
| 49 ntp_snippets::NTPSnippetsServiceObserver> observer_; | 50 ntp_snippets::NTPSnippetsServiceObserver> observer_; |
| 50 | 51 |
| 51 // Tracks whether we can already send messages to the page. | 52 // Tracks whether we can already send messages to the page. |
| 52 bool dom_loaded_; | 53 bool dom_loaded_; |
| 53 | 54 |
| 54 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; | 55 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(SnippetsInternalsMessageHandler); | 57 DISALLOW_COPY_AND_ASSIGN(SnippetsInternalsMessageHandler); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 #endif // CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ | 60 #endif // CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ |
| OLD | NEW |