| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NTP_MOST_VISITED_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Callback for TopSites. | 83 // Callback for TopSites. |
| 84 void OnMostVisitedUrlsAvailable(const history::MostVisitedURLList& data); | 84 void OnMostVisitedUrlsAvailable(const history::MostVisitedURLList& data); |
| 85 | 85 |
| 86 // Puts the passed URL in the blacklist (so it does not show as a thumbnail). | 86 // Puts the passed URL in the blacklist (so it does not show as a thumbnail). |
| 87 void BlacklistUrl(const GURL& url); | 87 void BlacklistUrl(const GURL& url); |
| 88 | 88 |
| 89 // Returns the key used in url_blacklist_ for the passed |url|. | 89 // Returns the key used in url_blacklist_ for the passed |url|. |
| 90 std::string GetDictionaryKeyForUrl(const std::string& url); | 90 std::string GetDictionaryKeyForUrl(const std::string& url); |
| 91 | 91 |
| 92 // Removes recommended URLs if a matching URL is already open in the Browser, | |
| 93 // if the Most Visited Tile Placement experiment is enabled, and the client is | |
| 94 // in the experiment group. | |
| 95 void MaybeRemovePageValues(); | |
| 96 | |
| 97 // Sends pages_value_ to the javascript side and resets page_value_. | 92 // Sends pages_value_ to the javascript side and resets page_value_. |
| 98 void SendPagesValue(); | 93 void SendPagesValue(); |
| 99 | 94 |
| 100 content::NotificationRegistrar registrar_; | 95 content::NotificationRegistrar registrar_; |
| 101 | 96 |
| 102 // The most visited URLs, in priority order. | 97 // The most visited URLs, in priority order. |
| 103 // Only used for matching up clicks on the page to which most visited entry | 98 // Only used for matching up clicks on the page to which most visited entry |
| 104 // was clicked on for metrics purposes. | 99 // was clicked on for metrics purposes. |
| 105 std::vector<GURL> most_visited_urls_; | 100 std::vector<GURL> most_visited_urls_; |
| 106 | 101 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 117 // Whether the user has performed a "tracked" action to leave the page or not. | 112 // Whether the user has performed a "tracked" action to leave the page or not. |
| 118 bool user_action_logged_; | 113 bool user_action_logged_; |
| 119 | 114 |
| 120 // For callbacks which may be run after destruction. | 115 // For callbacks which may be run after destruction. |
| 121 base::WeakPtrFactory<MostVisitedHandler> weak_ptr_factory_; | 116 base::WeakPtrFactory<MostVisitedHandler> weak_ptr_factory_; |
| 122 | 117 |
| 123 DISALLOW_COPY_AND_ASSIGN(MostVisitedHandler); | 118 DISALLOW_COPY_AND_ASSIGN(MostVisitedHandler); |
| 124 }; | 119 }; |
| 125 | 120 |
| 126 #endif // CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ | 121 #endif // CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ |
| OLD | NEW |