| 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 <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 bool GetUrlFromValue(Value* value, GURL* url); | 66 bool GetUrlFromValue(Value* value, GURL* url); |
| 67 bool GetTimeFromValue(Value* value, base::Time* time); | 67 bool GetTimeFromValue(Value* value, base::Time* time); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // Base class for history funciton APIs which require async interaction with | 70 // Base class for history funciton APIs which require async interaction with |
| 71 // chrome services and the extension thread. | 71 // chrome services and the extension thread. |
| 72 class HistoryFunctionWithCallback : public HistoryFunction { | 72 class HistoryFunctionWithCallback : public HistoryFunction { |
| 73 public: | 73 public: |
| 74 HistoryFunctionWithCallback(); | 74 HistoryFunctionWithCallback(); |
| 75 ~HistoryFunctionWithCallback(); | 75 virtual ~HistoryFunctionWithCallback(); |
| 76 | 76 |
| 77 // Return true if the async call was completed, false otherwise. | 77 // Return true if the async call was completed, false otherwise. |
| 78 virtual bool RunAsyncImpl() = 0; | 78 virtual bool RunAsyncImpl() = 0; |
| 79 | 79 |
| 80 // Call this method to report the results of the async method to the caller. | 80 // Call this method to report the results of the async method to the caller. |
| 81 // This method calls Release(). | 81 // This method calls Release(). |
| 82 virtual void SendAsyncResponse(); | 82 virtual void SendAsyncResponse(); |
| 83 | 83 |
| 84 // Override HistoryFunction::RunImpl. | 84 // Override HistoryFunction::RunImpl. |
| 85 virtual bool RunImpl(); | 85 virtual bool RunImpl(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 class DeleteRangeHistoryFunction : public HistoryFunctionWithCallback { | 142 class DeleteRangeHistoryFunction : public HistoryFunctionWithCallback { |
| 143 public: | 143 public: |
| 144 virtual bool RunAsyncImpl(); | 144 virtual bool RunAsyncImpl(); |
| 145 DECLARE_EXTENSION_FUNCTION_NAME("history.deleteRange"); | 145 DECLARE_EXTENSION_FUNCTION_NAME("history.deleteRange"); |
| 146 | 146 |
| 147 // Callback for the history service to acknowledge deletion. | 147 // Callback for the history service to acknowledge deletion. |
| 148 void DeleteComplete(); | 148 void DeleteComplete(); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ | 151 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HISTORY_API_H_ |
| OLD | NEW |