| 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_HISTORY_TOP_SITES_EXTENSION_API_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ |
| 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ | 6 #define CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/cancelable_request.h" | 9 #include "chrome/browser/cancelable_request.h" |
| 10 #include "chrome/browser/extensions/extension_function.h" | 10 #include "chrome/browser/extensions/extension_function.h" |
| 11 #include "chrome/browser/history/history_types.h" | 11 #include "chrome/browser/history/history_types.h" |
| 12 | 12 |
| 13 class GetTopSitesFunction : public AsyncExtensionFunction { | 13 class GetTopSitesFunction : public AsyncExtensionFunction { |
| 14 public: | 14 public: |
| 15 GetTopSitesFunction(); | 15 GetTopSitesFunction(); |
| 16 virtual ~GetTopSitesFunction(); | 16 |
| 17 protected: |
| 17 virtual bool RunImpl() OVERRIDE; | 18 virtual bool RunImpl() OVERRIDE; |
| 18 DECLARE_EXTENSION_FUNCTION_NAME("topSites.get") | 19 DECLARE_EXTENSION_FUNCTION_NAME("topSites.get") |
| 19 | 20 |
| 20 private: | 21 private: |
| 22 virtual ~GetTopSitesFunction(); |
| 23 |
| 21 void OnMostVisitedURLsAvailable( | 24 void OnMostVisitedURLsAvailable( |
| 22 const history::MostVisitedURLList& data); | 25 const history::MostVisitedURLList& data); |
| 23 | 26 |
| 24 CancelableRequestConsumer topsites_consumer_; | 27 CancelableRequestConsumer topsites_consumer_; |
| 25 }; | 28 }; |
| 26 | 29 |
| 27 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ | 30 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ |
| OLD | NEW |