Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Side by Side Diff: components/ntp_tiles/webui/ntp_tiles_internals_message_handler_client.h

Issue 2584483002: Fix ntp-tiles-internals crash in incognito mode (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_NTP_TILES_INTERNALS_MESSAGE_HANDLER_CLIENT_H_ 5 #ifndef COMPONENTS_NTP_TILES_WEBUI_NTP_TILES_INTERNALS_MESSAGE_HANDLER_CLIENT_H_
6 #define COMPONENTS_NTP_TILES_WEBUI_NTP_TILES_INTERNALS_MESSAGE_HANDLER_CLIENT_H_ 6 #define COMPONENTS_NTP_TILES_WEBUI_NTP_TILES_INTERNALS_MESSAGE_HANDLER_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 24
25 class MostVisitedSites; 25 class MostVisitedSites;
26 class PopularSites; 26 class PopularSites;
27 27
28 // Implemented by embedders to hook up NTPTilesInternalsMessageHandler. 28 // Implemented by embedders to hook up NTPTilesInternalsMessageHandler.
29 class NTPTilesInternalsMessageHandlerClient { 29 class NTPTilesInternalsMessageHandlerClient {
30 public: 30 public:
31 // Returns the PrefService for the embedder and containing WebUI page. 31 // Returns the PrefService for the embedder and containing WebUI page.
32 virtual PrefService* GetPrefs() = 0; 32 virtual PrefService* GetPrefs() = 0;
33 33
34 // False if in a browser mode (e.g. incognito) where tiles aren't supported.
35 virtual bool SupportsNTPTiles() = 0;
36
34 // Returns true if the given source is enabled (even if, in practice, none of 37 // Returns true if the given source is enabled (even if, in practice, none of
35 // the tiles would come from it). 38 // the tiles would come from it).
36 virtual bool DoesSourceExist(NTPTileSource source) = 0; 39 virtual bool DoesSourceExist(NTPTileSource source) = 0;
37 40
38 // Creates a new MostVisitedSites based on the context pf the WebUI page. 41 // Creates a new MostVisitedSites based on the context pf the WebUI page.
39 virtual std::unique_ptr<ntp_tiles::MostVisitedSites> 42 virtual std::unique_ptr<ntp_tiles::MostVisitedSites>
40 MakeMostVisitedSites() = 0; 43 MakeMostVisitedSites() = 0;
41 44
42 // Creates a new PopularSites based on the context pf the WebUI page. 45 // Creates a new PopularSites based on the context pf the WebUI page.
43 virtual std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() = 0; 46 virtual std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() = 0;
(...skipping 18 matching lines...) Expand all
62 NTPTilesInternalsMessageHandlerClient(); 65 NTPTilesInternalsMessageHandlerClient();
63 virtual ~NTPTilesInternalsMessageHandlerClient(); 66 virtual ~NTPTilesInternalsMessageHandlerClient();
64 67
65 private: 68 private:
66 DISALLOW_COPY_AND_ASSIGN(NTPTilesInternalsMessageHandlerClient); 69 DISALLOW_COPY_AND_ASSIGN(NTPTilesInternalsMessageHandlerClient);
67 }; 70 };
68 71
69 } // namespace ntp_tiles 72 } // namespace ntp_tiles
70 73
71 #endif // COMPONENTS_NTP_TILES_WEBUI_NTP_TILES_INTERNALS_MESSAGE_HANDLER_CLIENT _H_ 74 #endif // COMPONENTS_NTP_TILES_WEBUI_NTP_TILES_INTERNALS_MESSAGE_HANDLER_CLIENT _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698