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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Used for tracking registrations to history service notifications. | 50 // Used for tracking registrations to history service notifications. |
51 content::NotificationRegistrar registrar_; | 51 content::NotificationRegistrar registrar_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter); | 53 DISALLOW_COPY_AND_ASSIGN(HistoryEventRouter); |
54 }; | 54 }; |
55 | 55 |
56 class HistoryAPI : public ProfileKeyedAPI, | 56 class HistoryAPI : public ProfileKeyedAPI, |
57 public EventRouter::Observer { | 57 public EventRouter::Observer { |
58 public: | 58 public: |
59 explicit HistoryAPI(Profile* profile); | 59 explicit HistoryAPI(content::BrowserContext* context); |
60 virtual ~HistoryAPI(); | 60 virtual ~HistoryAPI(); |
61 | 61 |
62 // BrowserContextKeyedService implementation. | 62 // BrowserContextKeyedService implementation. |
63 virtual void Shutdown() OVERRIDE; | 63 virtual void Shutdown() OVERRIDE; |
64 | 64 |
65 // ProfileKeyedAPI implementation. | 65 // ProfileKeyedAPI implementation. |
66 static ProfileKeyedAPIFactory<HistoryAPI>* GetFactoryInstance(); | 66 static ProfileKeyedAPIFactory<HistoryAPI>* GetFactoryInstance(); |
67 | 67 |
68 // EventRouter::Observer implementation. | 68 // EventRouter::Observer implementation. |
69 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 69 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
70 | 70 |
71 private: | 71 private: |
72 friend class ProfileKeyedAPIFactory<HistoryAPI>; | 72 friend class ProfileKeyedAPIFactory<HistoryAPI>; |
73 | 73 |
74 Profile* profile_; | 74 content::BrowserContext* browser_context_; |
75 | 75 |
76 // ProfileKeyedAPI implementation. | 76 // ProfileKeyedAPI implementation. |
77 static const char* service_name() { | 77 static const char* service_name() { |
78 return "HistoryAPI"; | 78 return "HistoryAPI"; |
79 } | 79 } |
80 static const bool kServiceIsNULLWhileTesting = true; | 80 static const bool kServiceIsNULLWhileTesting = true; |
81 | 81 |
82 // Created lazily upon OnListenerAdded. | 82 // Created lazily upon OnListenerAdded. |
83 scoped_ptr<HistoryEventRouter> history_event_router_; | 83 scoped_ptr<HistoryEventRouter> history_event_router_; |
84 }; | 84 }; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // HistoryFunctionWithCallback: | 205 // HistoryFunctionWithCallback: |
206 virtual bool RunAsyncImpl() OVERRIDE; | 206 virtual bool RunAsyncImpl() OVERRIDE; |
207 | 207 |
208 // Callback for the history service to acknowledge deletion. | 208 // Callback for the history service to acknowledge deletion. |
209 void DeleteComplete(); | 209 void DeleteComplete(); |
210 }; | 210 }; |
211 | 211 |
212 } // namespace extensions | 212 } // namespace extensions |
213 | 213 |
214 #endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ | 214 #endif // CHROME_BROWSER_EXTENSIONS_API_HISTORY_HISTORY_API_H_ |
OLD | NEW |