| 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 COMPONENTS_NTP_TILES_WEBUI_POPULAR_SITES_HANDLER_CLIENT_H_ | 5 #ifndef COMPONENTS_NTP_TILES_WEBUI_POPULAR_SITES_HANDLER_CLIENT_H_ |
| 6 #define COMPONENTS_NTP_TILES_WEBUI_POPULAR_SITES_HANDLER_CLIENT_H_ | 6 #define COMPONENTS_NTP_TILES_WEBUI_POPULAR_SITES_HANDLER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 | 14 |
| 15 class PrefService; | 15 class PrefService; |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class Value; | 18 class Value; |
| 19 class ListValue; | 19 class ListValue; |
| 20 class SequencedWorkerPool; | |
| 21 } // namespace base | 20 } // namespace base |
| 22 | 21 |
| 23 namespace ntp_tiles { | 22 namespace ntp_tiles { |
| 24 | 23 |
| 25 class PopularSites; | 24 class PopularSites; |
| 26 | 25 |
| 27 // Implemented by embedders to hook up PopularSitesInternalsMessageHandler. | 26 // Implemented by embedders to hook up PopularSitesInternalsMessageHandler. |
| 28 class PopularSitesInternalsMessageHandlerClient { | 27 class PopularSitesInternalsMessageHandlerClient { |
| 29 public: | 28 public: |
| 30 // Returns the blocking pool for hte embedder. | |
| 31 virtual base::SequencedWorkerPool* GetBlockingPool() = 0; | |
| 32 | |
| 33 // Returns the PrefService for the embedder and containing WebUI page. | 29 // Returns the PrefService for the embedder and containing WebUI page. |
| 34 virtual PrefService* GetPrefs() = 0; | 30 virtual PrefService* GetPrefs() = 0; |
| 35 | 31 |
| 36 // Creates a new PopularSites based on the context pf the WebUI page. | 32 // Creates a new PopularSites based on the context pf the WebUI page. |
| 37 virtual std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() = 0; | 33 virtual std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() = 0; |
| 38 | 34 |
| 39 // Registers a callback in Javascript. See content::WebUI and web::WebUIIOS. | 35 // Registers a callback in Javascript. See content::WebUI and web::WebUIIOS. |
| 40 virtual void RegisterMessageCallback( | 36 virtual void RegisterMessageCallback( |
| 41 const std::string& message, | 37 const std::string& message, |
| 42 const base::Callback<void(const base::ListValue*)>& callback) = 0; | 38 const base::Callback<void(const base::ListValue*)>& callback) = 0; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 PopularSitesInternalsMessageHandlerClient(); | 52 PopularSitesInternalsMessageHandlerClient(); |
| 57 virtual ~PopularSitesInternalsMessageHandlerClient(); | 53 virtual ~PopularSitesInternalsMessageHandlerClient(); |
| 58 | 54 |
| 59 private: | 55 private: |
| 60 DISALLOW_COPY_AND_ASSIGN(PopularSitesInternalsMessageHandlerClient); | 56 DISALLOW_COPY_AND_ASSIGN(PopularSitesInternalsMessageHandlerClient); |
| 61 }; | 57 }; |
| 62 | 58 |
| 63 } // namespace ntp_tiles | 59 } // namespace ntp_tiles |
| 64 | 60 |
| 65 #endif // COMPONENTS_NTP_TILES_WEBUI_POPULAR_SITES_HANDLER_CLIENT_H_ | 61 #endif // COMPONENTS_NTP_TILES_WEBUI_POPULAR_SITES_HANDLER_CLIENT_H_ |
| OLD | NEW |