| 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 DECLARE_EXTENSION_FUNCTION_NAME("topSites.get") |
| 16 |
| 15 GetTopSitesFunction(); | 17 GetTopSitesFunction(); |
| 18 |
| 19 protected: |
| 16 virtual ~GetTopSitesFunction(); | 20 virtual ~GetTopSitesFunction(); |
| 21 |
| 22 // ExtensionFunction: |
| 17 virtual bool RunImpl() OVERRIDE; | 23 virtual bool RunImpl() OVERRIDE; |
| 18 DECLARE_EXTENSION_FUNCTION_NAME("topSites.get") | |
| 19 | 24 |
| 20 private: | 25 private: |
| 21 void OnMostVisitedURLsAvailable( | 26 void OnMostVisitedURLsAvailable( |
| 22 const history::MostVisitedURLList& data); | 27 const history::MostVisitedURLList& data); |
| 23 | 28 |
| 24 CancelableRequestConsumer topsites_consumer_; | 29 CancelableRequestConsumer topsites_consumer_; |
| 25 }; | 30 }; |
| 26 | 31 |
| 27 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ | 32 #endif // CHROME_BROWSER_HISTORY_TOP_SITES_EXTENSION_API_H_ |
| OLD | NEW |