| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SEARCH_INSTANT_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "build/build_config.h" |
| 17 #include "components/history/core/browser/history_types.h" | 18 #include "components/history/core/browser/history_types.h" |
| 18 #include "components/history/core/browser/top_sites_observer.h" | 19 #include "components/history/core/browser/top_sites_observer.h" |
| 19 #include "components/keyed_service/core/keyed_service.h" | 20 #include "components/keyed_service/core/keyed_service.h" |
| 20 #include "components/ntp_tiles/most_visited_sites.h" | 21 #include "components/ntp_tiles/most_visited_sites.h" |
| 21 #include "components/ntp_tiles/ntp_tile.h" | 22 #include "components/ntp_tiles/ntp_tile.h" |
| 22 #include "components/search_engines/template_url_service_observer.h" | 23 #include "components/search_engines/template_url_service_observer.h" |
| 23 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
| 25 #include "url/gurl.h" | 26 #include "url/gurl.h" |
| 26 | 27 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void OnTopSitesReceived(const history::MostVisitedURLList& data); | 139 void OnTopSitesReceived(const history::MostVisitedURLList& data); |
| 139 | 140 |
| 140 // ntp_tiles::MostVisitedSites::Observer implementation. | 141 // ntp_tiles::MostVisitedSites::Observer implementation. |
| 141 void OnMostVisitedURLsAvailable( | 142 void OnMostVisitedURLsAvailable( |
| 142 const ntp_tiles::NTPTilesVector& tiles) override; | 143 const ntp_tiles::NTPTilesVector& tiles) override; |
| 143 void OnIconMadeAvailable(const GURL& site_url) override; | 144 void OnIconMadeAvailable(const GURL& site_url) override; |
| 144 | 145 |
| 145 // Notifies the observer about the last known most visited items. | 146 // Notifies the observer about the last known most visited items. |
| 146 void NotifyAboutMostVisitedItems(); | 147 void NotifyAboutMostVisitedItems(); |
| 147 | 148 |
| 148 #if defined(ENABLE_THEMES) | 149 #if !defined(OS_ANDROID) |
| 149 // Theme changed notification handler. | 150 // Theme changed notification handler. |
| 150 void OnThemeChanged(); | 151 void OnThemeChanged(); |
| 151 #endif | 152 #endif |
| 152 | 153 |
| 153 void ResetInstantSearchPrerendererIfNecessary(); | 154 void ResetInstantSearchPrerendererIfNecessary(); |
| 154 | 155 |
| 155 Profile* const profile_; | 156 Profile* const profile_; |
| 156 | 157 |
| 157 // The TemplateURLService that we are observing. It will outlive this | 158 // The TemplateURLService that we are observing. It will outlive this |
| 158 // InstantService due to the dependency declared in InstantServiceFactory. | 159 // InstantService due to the dependency declared in InstantServiceFactory. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 186 std::unique_ptr<ntp_tiles::MostVisitedSites> most_visited_sites_; | 187 std::unique_ptr<ntp_tiles::MostVisitedSites> most_visited_sites_; |
| 187 scoped_refptr<history::TopSites> top_sites_; | 188 scoped_refptr<history::TopSites> top_sites_; |
| 188 | 189 |
| 189 // Used for Top Sites async retrieval. | 190 // Used for Top Sites async retrieval. |
| 190 base::WeakPtrFactory<InstantService> weak_ptr_factory_; | 191 base::WeakPtrFactory<InstantService> weak_ptr_factory_; |
| 191 | 192 |
| 192 DISALLOW_COPY_AND_ASSIGN(InstantService); | 193 DISALLOW_COPY_AND_ASSIGN(InstantService); |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 #endif // CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ | 196 #endif // CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ |
| OLD | NEW |