| 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 #include "chrome/browser/extensions/api/history/history_api.h" | 5 #include "chrome/browser/extensions/api/history/history_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 HistoryAPI::~HistoryAPI() { | 211 HistoryAPI::~HistoryAPI() { |
| 212 } | 212 } |
| 213 | 213 |
| 214 void HistoryAPI::Shutdown() { | 214 void HistoryAPI::Shutdown() { |
| 215 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 215 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
| 216 this); | 216 this); |
| 217 } | 217 } |
| 218 | 218 |
| 219 static base::LazyInstance<ProfileKeyedAPIFactory<HistoryAPI> > | 219 static base::LazyInstance<BrowserContextKeyedAPIFactory<HistoryAPI> > |
| 220 g_factory = LAZY_INSTANCE_INITIALIZER; | 220 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 221 | 221 |
| 222 // static | 222 // static |
| 223 ProfileKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() { | 223 BrowserContextKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() { |
| 224 return g_factory.Pointer(); | 224 return g_factory.Pointer(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 template<> | 227 template <> |
| 228 void ProfileKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() { | 228 void BrowserContextKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() { |
| 229 DependsOn(ActivityLog::GetFactoryInstance()); | 229 DependsOn(ActivityLog::GetFactoryInstance()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { | 232 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 233 history_event_router_.reset( | 233 history_event_router_.reset( |
| 234 new HistoryEventRouter(Profile::FromBrowserContext(browser_context_))); | 234 new HistoryEventRouter(Profile::FromBrowserContext(browser_context_))); |
| 235 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( | 235 ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver( |
| 236 this); | 236 this); |
| 237 } | 237 } |
| 238 | 238 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 } | 482 } |
| 483 | 483 |
| 484 return true; | 484 return true; |
| 485 } | 485 } |
| 486 | 486 |
| 487 void HistoryDeleteAllFunction::DeleteComplete() { | 487 void HistoryDeleteAllFunction::DeleteComplete() { |
| 488 SendAsyncResponse(); | 488 SendAsyncResponse(); |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace extensions | 491 } // namespace extensions |
| OLD | NEW |