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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 private: | 30 private: |
31 // content::WebUIMessageHandler: | 31 // content::WebUIMessageHandler: |
32 void RegisterMessages() override; | 32 void RegisterMessages() override; |
33 | 33 |
34 // ntp_snippets::ContentSuggestionsService::Observer: | 34 // ntp_snippets::ContentSuggestionsService::Observer: |
35 void OnNewSuggestions(ntp_snippets::Category category) override; | 35 void OnNewSuggestions(ntp_snippets::Category category) override; |
36 void OnCategoryStatusChanged( | 36 void OnCategoryStatusChanged( |
37 ntp_snippets::Category category, | 37 ntp_snippets::Category category, |
38 ntp_snippets::CategoryStatus new_status) override; | 38 ntp_snippets::CategoryStatus new_status) override; |
| 39 void OnSuggestionInvalidated(ntp_snippets::Category category, |
| 40 const std::string& suggestion_id) override; |
39 void ContentSuggestionsServiceShutdown() override; | 41 void ContentSuggestionsServiceShutdown() override; |
40 | 42 |
41 void HandleRefreshContent(const base::ListValue* args); | 43 void HandleRefreshContent(const base::ListValue* args); |
42 void HandleDownload(const base::ListValue* args); | 44 void HandleDownload(const base::ListValue* args); |
43 void HandleClearCachedSuggestions(const base::ListValue* args); | 45 void HandleClearCachedSuggestions(const base::ListValue* args); |
44 void HandleClearDismissedSuggestions(const base::ListValue* args); | 46 void HandleClearDismissedSuggestions(const base::ListValue* args); |
45 | 47 |
46 void SendAllContent(); | 48 void SendAllContent(); |
47 void SendHosts(); | 49 void SendHosts(); |
48 void SendContentSuggestions(); | 50 void SendContentSuggestions(); |
49 void SendBoolean(const std::string& name, bool value); | 51 void SendBoolean(const std::string& name, bool value); |
50 void SendString(const std::string& name, const std::string& value); | 52 void SendString(const std::string& name, const std::string& value); |
51 | 53 |
52 ScopedObserver<ntp_snippets::ContentSuggestionsService, | 54 ScopedObserver<ntp_snippets::ContentSuggestionsService, |
53 ntp_snippets::ContentSuggestionsService::Observer> | 55 ntp_snippets::ContentSuggestionsService::Observer> |
54 content_suggestions_service_observer_; | 56 content_suggestions_service_observer_; |
55 | 57 |
56 // Tracks whether we can already send messages to the page. | 58 // Tracks whether we can already send messages to the page. |
57 bool dom_loaded_; | 59 bool dom_loaded_; |
58 | 60 |
59 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; | 61 ntp_snippets::NTPSnippetsService* ntp_snippets_service_; |
60 ntp_snippets::ContentSuggestionsService* content_suggestions_service_; | 62 ntp_snippets::ContentSuggestionsService* content_suggestions_service_; |
61 | 63 |
62 DISALLOW_COPY_AND_ASSIGN(SnippetsInternalsMessageHandler); | 64 DISALLOW_COPY_AND_ASSIGN(SnippetsInternalsMessageHandler); |
63 }; | 65 }; |
64 | 66 |
65 #endif // CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ | 67 #endif // CHROME_BROWSER_UI_WEBUI_SNIPPETS_INTERNALS_MESSAGE_HANDLER_H_ |
OLD | NEW |