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 |
11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
12 #include "chrome/browser/history/history.h" | 12 #include "chrome/browser/history/history.h" |
13 #include "chrome/browser/history/history_notifications.h" | 13 #include "chrome/browser/history/history_notifications.h" |
14 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
15 | 15 |
16 // Observes History service and routes the notifications as events to the | 16 // Observes History service and routes the notifications as events to the |
17 // extension system. | 17 // extension system. |
18 class ExtensionHistoryEventRouter : public NotificationObserver { | 18 class ExtensionHistoryEventRouter : public NotificationObserver { |
19 public: | 19 public: |
20 explicit ExtensionHistoryEventRouter(); | 20 explicit ExtensionHistoryEventRouter(); |
21 virtual ~ExtensionHistoryEventRouter(); | 21 virtual ~ExtensionHistoryEventRouter(); |
22 | 22 |
23 void ObserveProfile(Profile* profile); | 23 void ObserveProfile(Profile* profile); |
24 | 24 |
25 private: | 25 private: |
26 // NotificationObserver::Observe. | 26 // NotificationObserver::Observe. |
27 virtual void Observe(NotificationType type, | 27 virtual void Observe(int type, |
28 const NotificationSource& source, | 28 const NotificationSource& source, |
29 const NotificationDetails& details); | 29 const NotificationDetails& details); |
30 | 30 |
31 void HistoryUrlVisited(Profile* profile, | 31 void HistoryUrlVisited(Profile* profile, |
32 const history::URLVisitedDetails* details); | 32 const history::URLVisitedDetails* details); |
33 | 33 |
34 void HistoryUrlsRemoved(Profile* profile, | 34 void HistoryUrlsRemoved(Profile* profile, |
35 const history::URLsDeletedDetails* details); | 35 const history::URLsDeletedDetails* details); |
36 | 36 |
37 void DispatchEvent(Profile* profile, | 37 void DispatchEvent(Profile* profile, |
(...skipping 92 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 |