| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 static base::LazyInstance<ProfileKeyedAPIFactory<HistoryAPI> > | 217 static base::LazyInstance<ProfileKeyedAPIFactory<HistoryAPI> > |
| 218 g_factory = LAZY_INSTANCE_INITIALIZER; | 218 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 219 | 219 |
| 220 // static | 220 // static |
| 221 ProfileKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() { | 221 ProfileKeyedAPIFactory<HistoryAPI>* HistoryAPI::GetFactoryInstance() { |
| 222 return g_factory.Pointer(); | 222 return g_factory.Pointer(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 template<> | 225 template<> |
| 226 void ProfileKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() { | 226 void ProfileKeyedAPIFactory<HistoryAPI>::DeclareFactoryDependencies() { |
| 227 DependsOn(ActivityLogFactory::GetInstance()); | 227 DependsOn(ActivityLog::GetFactoryInstance()); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { | 230 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 231 history_event_router_.reset(new HistoryEventRouter(profile_)); | 231 history_event_router_.reset(new HistoryEventRouter(profile_)); |
| 232 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 232 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void HistoryFunction::Run() { | 235 void HistoryFunction::Run() { |
| 236 if (!RunImpl()) { | 236 if (!RunImpl()) { |
| 237 SendResponse(false); | 237 SendResponse(false); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 478 } |
| 479 | 479 |
| 480 return true; | 480 return true; |
| 481 } | 481 } |
| 482 | 482 |
| 483 void HistoryDeleteAllFunction::DeleteComplete() { | 483 void HistoryDeleteAllFunction::DeleteComplete() { |
| 484 SendAsyncResponse(); | 484 SendAsyncResponse(); |
| 485 } | 485 } |
| 486 | 486 |
| 487 } // namespace extensions | 487 } // namespace extensions |
| OLD | NEW |