| 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_EXTENSIONS_EXTENSION_HISTORY_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 DISALLOW_COPY_AND_ASSIGN(ExtensionHistoryEventRouter); | 44 DISALLOW_COPY_AND_ASSIGN(ExtensionHistoryEventRouter); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 | 47 |
| 48 // Base class for history function APIs. | 48 // Base class for history function APIs. |
| 49 class HistoryFunction : public AsyncExtensionFunction { | 49 class HistoryFunction : public AsyncExtensionFunction { |
| 50 public: | 50 public: |
| 51 virtual void Run(); | 51 virtual void Run(); |
| 52 virtual bool RunImpl() = 0; | 52 virtual bool RunImpl() = 0; |
| 53 | 53 |
| 54 bool GetUrlFromValue(Value* value, GURL* url); | 54 bool GetUrlFromValue(base::Value* value, GURL* url); |
| 55 bool GetTimeFromValue(Value* value, base::Time* time); | 55 bool GetTimeFromValue(base::Value* value, base::Time* time); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // Base class for history funciton APIs which require async interaction with | 58 // Base class for history funciton APIs which require async interaction with |
| 59 // chrome services and the extension thread. | 59 // chrome services and the extension thread. |
| 60 class HistoryFunctionWithCallback : public HistoryFunction { | 60 class HistoryFunctionWithCallback : public HistoryFunction { |
| 61 public: | 61 public: |
| 62 HistoryFunctionWithCallback(); | 62 HistoryFunctionWithCallback(); |
| 63 virtual ~HistoryFunctionWithCallback(); | 63 virtual ~HistoryFunctionWithCallback(); |
| 64 | 64 |
| 65 // Return true if the async call was completed, false otherwise. | 65 // Return true if the async call was completed, false otherwise. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 class DeleteRangeHistoryFunction : public HistoryFunctionWithCallback { | 130 class DeleteRangeHistoryFunction : public HistoryFunctionWithCallback { |
| 131 public: | 131 public: |
| 132 virtual bool RunAsyncImpl(); | 132 virtual bool RunAsyncImpl(); |
| 133 DECLARE_EXTENSION_FUNCTION_NAME("history.deleteRange"); | 133 DECLARE_EXTENSION_FUNCTION_NAME("history.deleteRange"); |
| 134 | 134 |
| 135 // Callback for the history service to acknowledge deletion. | 135 // Callback for the history service to acknowledge deletion. |
| 136 void DeleteComplete(); | 136 void DeleteComplete(); |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ | 139 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ |
| OLD | NEW |