| 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 #include "chrome/browser/extensions/activity_log/activity_log.h" | 5 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 action->set_arg_url(arg_url); | 331 action->set_arg_url(arg_url); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace | 335 } // namespace |
| 336 | 336 |
| 337 namespace extensions { | 337 namespace extensions { |
| 338 | 338 |
| 339 // SET THINGS UP. -------------------------------------------------------------- | 339 // SET THINGS UP. -------------------------------------------------------------- |
| 340 | 340 |
| 341 static base::LazyInstance<ProfileKeyedAPIFactory<ActivityLog> > g_factory = | 341 static base::LazyInstance<BrowserContextKeyedAPIFactory<ActivityLog> > |
| 342 LAZY_INSTANCE_INITIALIZER; | 342 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 343 | 343 |
| 344 ProfileKeyedAPIFactory<ActivityLog>* ActivityLog::GetFactoryInstance() { | 344 BrowserContextKeyedAPIFactory<ActivityLog>* ActivityLog::GetFactoryInstance() { |
| 345 return g_factory.Pointer(); | 345 return g_factory.Pointer(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 // static | 348 // static |
| 349 ActivityLog* ActivityLog::GetInstance(content::BrowserContext* context) { | 349 ActivityLog* ActivityLog::GetInstance(content::BrowserContext* context) { |
| 350 return ActivityLog::GetFactoryInstance()->GetForProfile( | 350 return ActivityLog::GetFactoryInstance()->Get( |
| 351 Profile::FromBrowserContext(context)); | 351 Profile::FromBrowserContext(context)); |
| 352 } | 352 } |
| 353 | 353 |
| 354 // Use GetInstance instead of directly creating an ActivityLog. | 354 // Use GetInstance instead of directly creating an ActivityLog. |
| 355 ActivityLog::ActivityLog(content::BrowserContext* context) | 355 ActivityLog::ActivityLog(content::BrowserContext* context) |
| 356 : database_policy_(NULL), | 356 : database_policy_(NULL), |
| 357 database_policy_type_(ActivityLogPolicy::POLICY_INVALID), | 357 database_policy_type_(ActivityLogPolicy::POLICY_INVALID), |
| 358 uma_policy_(NULL), | 358 uma_policy_(NULL), |
| 359 profile_(Profile::FromBrowserContext(context)), | 359 profile_(Profile::FromBrowserContext(context)), |
| 360 db_enabled_(false), | 360 db_enabled_(false), |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 RemoveURLs(urls); | 689 RemoveURLs(urls); |
| 690 } | 690 } |
| 691 | 691 |
| 692 void ActivityLog::DeleteDatabase() { | 692 void ActivityLog::DeleteDatabase() { |
| 693 if (!database_policy_) | 693 if (!database_policy_) |
| 694 return; | 694 return; |
| 695 database_policy_->DeleteDatabase(); | 695 database_policy_->DeleteDatabase(); |
| 696 } | 696 } |
| 697 | 697 |
| 698 template <> | 698 template <> |
| 699 void ProfileKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { | 699 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { |
| 700 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 700 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 701 DependsOn(InstallTrackerFactory::GetInstance()); | 701 DependsOn(InstallTrackerFactory::GetInstance()); |
| 702 } | 702 } |
| 703 | 703 |
| 704 } // namespace extensions | 704 } // namespace extensions |
| OLD | NEW |