| 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_EXTENSIONS_API_HISTORY_HISTORY_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 scoped_ptr<HistoryEventRouter> history_event_router_; | 82 scoped_ptr<HistoryEventRouter> history_event_router_; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 template <> | 85 template <> |
| 86 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies(); | 86 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies(); |
| 87 | 87 |
| 88 // Base class for history function APIs. | 88 // Base class for history function APIs. |
| 89 class HistoryFunction : public ChromeAsyncExtensionFunction { | 89 class HistoryFunction : public ChromeAsyncExtensionFunction { |
| 90 protected: | 90 protected: |
| 91 virtual ~HistoryFunction() {} | 91 virtual ~HistoryFunction() {} |
| 92 virtual void Run() OVERRIDE; | |
| 93 | 92 |
| 94 bool ValidateUrl(const std::string& url_string, GURL* url); | 93 bool ValidateUrl(const std::string& url_string, GURL* url); |
| 95 bool VerifyDeleteAllowed(); | 94 bool VerifyDeleteAllowed(); |
| 96 base::Time GetTime(double ms_from_epoch); | 95 base::Time GetTime(double ms_from_epoch); |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 // Base class for history funciton APIs which require async interaction with | 98 // Base class for history funciton APIs which require async interaction with |
| 100 // chrome services and the extension thread. | 99 // chrome services and the extension thread. |
| 101 class HistoryFunctionWithCallback : public HistoryFunction { | 100 class HistoryFunctionWithCallback : public HistoryFunction { |
| 102 public: | 101 public: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // HistoryFunctionWithCallback: | 203 // HistoryFunctionWithCallback: |
| 205 virtual bool RunAsyncImpl() OVERRIDE; | 204 virtual bool RunAsyncImpl() OVERRIDE; |
| 206 | 205 |
| 207 // Callback for the history service to acknowledge deletion. | 206 // Callback for the history service to acknowledge deletion. |
| 208 void DeleteComplete(); | 207 void DeleteComplete(); |
| 209 }; | 208 }; |
| 210 | 209 |
| 211 } // namespace extensions | 210 } // namespace extensions |
| 212 | 211 |
| 213 #endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ | 212 #endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ |
| OLD | NEW |