| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DOM_UI_MOST_VISITED_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_MOST_VISITED_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_MOST_VISITED_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_MOST_VISITED_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 virtual void Observe(NotificationType type, | 56 virtual void Observe(NotificationType type, |
| 57 const NotificationSource& source, | 57 const NotificationSource& source, |
| 58 const NotificationDetails& details); | 58 const NotificationDetails& details); |
| 59 | 59 |
| 60 const std::vector<GURL>& most_visited_urls() const { | 60 const std::vector<GURL>& most_visited_urls() const { |
| 61 return most_visited_urls_; | 61 return most_visited_urls_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 static void RegisterUserPrefs(PrefService* prefs); | 64 static void RegisterUserPrefs(PrefService* prefs); |
| 65 | 65 |
| 66 // Returns a vector containing the urls for the prepopulated pages. |
| 67 // Used only in testing. |
| 68 static std::vector<GURL> GetPrePopulatedUrls(); |
| 69 |
| 66 private: | 70 private: |
| 67 struct MostVisitedPage; | 71 struct MostVisitedPage; |
| 68 | 72 |
| 69 // Send a request to the HistoryService to get the most visited pages. | 73 // Send a request to the HistoryService to get the most visited pages. |
| 70 void StartQueryForMostVisited(); | 74 void StartQueryForMostVisited(); |
| 71 | 75 |
| 72 // Callback from the history system when the most visited list is available. | 76 // Callback from the history system when the most visited list is available. |
| 73 void OnSegmentUsageAvailable(CancelableRequestProvider::Handle handle, | 77 void OnSegmentUsageAvailable(CancelableRequestProvider::Handle handle, |
| 74 std::vector<PageUsageData*>* data); | 78 std::vector<PageUsageData*>* data); |
| 75 | 79 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // we get the first getMostVisited() call. | 139 // we get the first getMostVisited() call. |
| 136 bool got_first_most_visited_request_; | 140 bool got_first_most_visited_request_; |
| 137 | 141 |
| 138 // Keep the results of the db query here. | 142 // Keep the results of the db query here. |
| 139 scoped_ptr<ListValue> pages_value_; | 143 scoped_ptr<ListValue> pages_value_; |
| 140 | 144 |
| 141 DISALLOW_COPY_AND_ASSIGN(MostVisitedHandler); | 145 DISALLOW_COPY_AND_ASSIGN(MostVisitedHandler); |
| 142 }; | 146 }; |
| 143 | 147 |
| 144 #endif // CHROME_BROWSER_DOM_UI_MOST_VISITED_HANDLER_H_ | 148 #endif // CHROME_BROWSER_DOM_UI_MOST_VISITED_HANDLER_H_ |
| OLD | NEW |