| 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 if (watchdog_apps_active_ == 0 && | 495 if (watchdog_apps_active_ == 0 && |
| 496 !CommandLine::ForCurrentProcess()->HasSwitch( | 496 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 497 switches::kEnableExtensionActivityLogging)) { | 497 switches::kEnableExtensionActivityLogging)) { |
| 498 db_enabled_ = false; | 498 db_enabled_ = false; |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 // OnExtensionUnloaded will also be called right before this. | 502 // OnExtensionUnloaded will also be called right before this. |
| 503 void ActivityLog::OnExtensionUninstalled( | 503 void ActivityLog::OnExtensionUninstalled( |
| 504 content::BrowserContext* browser_context, | 504 content::BrowserContext* browser_context, |
| 505 const Extension* extension) { | 505 const Extension* extension, |
| 506 extensions::UninstallReason reason) { |
| 506 if (ActivityLogAPI::IsExtensionWhitelisted(extension->id()) && | 507 if (ActivityLogAPI::IsExtensionWhitelisted(extension->id()) && |
| 507 !CommandLine::ForCurrentProcess()->HasSwitch( | 508 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 508 switches::kEnableExtensionActivityLogging) && | 509 switches::kEnableExtensionActivityLogging) && |
| 509 watchdog_apps_active_ == 0) { | 510 watchdog_apps_active_ == 0) { |
| 510 DeleteDatabase(); | 511 DeleteDatabase(); |
| 511 } else if (database_policy_) { | 512 } else if (database_policy_) { |
| 512 database_policy_->RemoveExtensionData(extension->id()); | 513 database_policy_->RemoveExtensionData(extension->id()); |
| 513 } | 514 } |
| 514 } | 515 } |
| 515 | 516 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 database_policy_->DeleteDatabase(); | 693 database_policy_->DeleteDatabase(); |
| 693 } | 694 } |
| 694 | 695 |
| 695 template <> | 696 template <> |
| 696 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { | 697 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { |
| 697 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 698 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 698 DependsOn(ExtensionRegistryFactory::GetInstance()); | 699 DependsOn(ExtensionRegistryFactory::GetInstance()); |
| 699 } | 700 } |
| 700 | 701 |
| 701 } // namespace extensions | 702 } // namespace extensions |
| OLD | NEW |