| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "chrome/browser/cancelable_request.h" | 12 #include "chrome/browser/cancelable_request.h" |
| 13 #include "chrome/browser/history/history_types.h" | 13 #include "chrome/browser/history/history_types.h" |
| 14 #include "content/browser/webui/web_ui.h" | |
| 15 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 16 #include "content/public/browser/web_ui_message_handler.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 class PageUsageData; | 19 class PageUsageData; |
| 20 class PrefService; | 20 class PrefService; |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class ListValue; | 23 class ListValue; |
| 24 class Value; | 24 class Value; |
| 25 } | 25 } |
| 26 | 26 |
| 27 // The handler for Javascript messages related to the "most visited" view. | 27 // The handler for Javascript messages related to the "most visited" view. |
| 28 // | 28 // |
| 29 // This class manages one preference: | 29 // This class manages one preference: |
| 30 // - The URL blacklist: URLs we do not want to show in the thumbnails list. It | 30 // - The URL blacklist: URLs we do not want to show in the thumbnails list. It |
| 31 // is a dictionary for quick access (it associates a dummy boolean to the URL | 31 // is a dictionary for quick access (it associates a dummy boolean to the URL |
| 32 // string). | 32 // string). |
| 33 class MostVisitedHandler : public WebUIMessageHandler, | 33 class MostVisitedHandler : public content::WebUIMessageHandler, |
| 34 public content::NotificationObserver { | 34 public content::NotificationObserver { |
| 35 public: | 35 public: |
| 36 | 36 |
| 37 MostVisitedHandler(); | 37 MostVisitedHandler(); |
| 38 virtual ~MostVisitedHandler(); | 38 virtual ~MostVisitedHandler(); |
| 39 | 39 |
| 40 // WebUIMessageHandler override and implementation. | 40 // WebUIMessageHandler override and implementation. |
| 41 virtual void RegisterMessages() OVERRIDE; | 41 virtual void RegisterMessages() OVERRIDE; |
| 42 | 42 |
| 43 // Callback for the "getMostVisited" message. | 43 // Callback for the "getMostVisited" message. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // we get the first getMostVisited() call. | 99 // we get the first getMostVisited() call. |
| 100 bool got_first_most_visited_request_; | 100 bool got_first_most_visited_request_; |
| 101 | 101 |
| 102 // Keep the results of the db query here. | 102 // Keep the results of the db query here. |
| 103 scoped_ptr<base::ListValue> pages_value_; | 103 scoped_ptr<base::ListValue> pages_value_; |
| 104 | 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(MostVisitedHandler); | 105 DISALLOW_COPY_AND_ASSIGN(MostVisitedHandler); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 #endif // CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ | 108 #endif // CHROME_BROWSER_UI_WEBUI_NTP_MOST_VISITED_HANDLER_H_ |
| OLD | NEW |