| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 base::Time visit_time) override; | 45 base::Time visit_time) override; |
| 46 void OnURLsDeleted(history::HistoryService* history_service, | 46 void OnURLsDeleted(history::HistoryService* history_service, |
| 47 bool all_history, | 47 bool all_history, |
| 48 bool expired, | 48 bool expired, |
| 49 const history::URLRows& deleted_rows, | 49 const history::URLRows& deleted_rows, |
| 50 const std::set<GURL>& favicon_urls) override; | 50 const std::set<GURL>& favicon_urls) override; |
| 51 | 51 |
| 52 void DispatchEvent(Profile* profile, | 52 void DispatchEvent(Profile* profile, |
| 53 events::HistogramValue histogram_value, | 53 events::HistogramValue histogram_value, |
| 54 const std::string& event_name, | 54 const std::string& event_name, |
| 55 scoped_ptr<base::ListValue> event_args); | 55 std::unique_ptr<base::ListValue> event_args); |
| 56 | 56 |
| 57 Profile* profile_; | 57 Profile* profile_; |
| 58 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 58 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
| 59 history_service_observer_; | 59 history_service_observer_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter); | 61 DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class HistoryAPI : public BrowserContextKeyedAPI, public EventRouter::Observer { | 64 class HistoryAPI : public BrowserContextKeyedAPI, public EventRouter::Observer { |
| 65 public: | 65 public: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 80 | 80 |
| 81 content::BrowserContext* browser_context_; | 81 content::BrowserContext* browser_context_; |
| 82 | 82 |
| 83 // BrowserContextKeyedAPI implementation. | 83 // BrowserContextKeyedAPI implementation. |
| 84 static const char* service_name() { | 84 static const char* service_name() { |
| 85 return "HistoryAPI"; | 85 return "HistoryAPI"; |
| 86 } | 86 } |
| 87 static const bool kServiceIsNULLWhileTesting = true; | 87 static const bool kServiceIsNULLWhileTesting = true; |
| 88 | 88 |
| 89 // Created lazily upon OnListenerAdded. | 89 // Created lazily upon OnListenerAdded. |
| 90 scoped_ptr<HistoryEventRouter> history_event_router_; | 90 std::unique_ptr<HistoryEventRouter> history_event_router_; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 template <> | 93 template <> |
| 94 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies(); | 94 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies(); |
| 95 | 95 |
| 96 // Base class for history function APIs. | 96 // Base class for history function APIs. |
| 97 class HistoryFunction : public ChromeAsyncExtensionFunction { | 97 class HistoryFunction : public ChromeAsyncExtensionFunction { |
| 98 protected: | 98 protected: |
| 99 ~HistoryFunction() override {} | 99 ~HistoryFunction() override {} |
| 100 | 100 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // HistoryFunctionWithCallback: | 208 // HistoryFunctionWithCallback: |
| 209 bool RunAsyncImpl() override; | 209 bool RunAsyncImpl() override; |
| 210 | 210 |
| 211 // Callback for the history service to acknowledge deletion. | 211 // Callback for the history service to acknowledge deletion. |
| 212 void DeleteComplete(); | 212 void DeleteComplete(); |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 } // namespace extensions | 215 } // namespace extensions |
| 216 | 216 |
| 217 #endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ | 217 #endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ |
| OLD | NEW |