OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_storage_monitor.h" | 5 #include "chrome/browser/extensions/extension_storage_monitor.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 296 |
297 void ExtensionStorageMonitor::OnExtensionLoaded( | 297 void ExtensionStorageMonitor::OnExtensionLoaded( |
298 content::BrowserContext* browser_context, | 298 content::BrowserContext* browser_context, |
299 const Extension* extension) { | 299 const Extension* extension) { |
300 StartMonitoringStorage(extension); | 300 StartMonitoringStorage(extension); |
301 } | 301 } |
302 | 302 |
303 void ExtensionStorageMonitor::OnExtensionUnloaded( | 303 void ExtensionStorageMonitor::OnExtensionUnloaded( |
304 content::BrowserContext* browser_context, | 304 content::BrowserContext* browser_context, |
305 const Extension* extension, | 305 const Extension* extension, |
306 UnloadedExtensionInfo::Reason reason) { | 306 UnloadedExtensionReason reason) { |
307 StopMonitoringStorage(extension->id()); | 307 StopMonitoringStorage(extension->id()); |
308 } | 308 } |
309 | 309 |
310 void ExtensionStorageMonitor::OnExtensionWillBeInstalled( | 310 void ExtensionStorageMonitor::OnExtensionWillBeInstalled( |
311 content::BrowserContext* browser_context, | 311 content::BrowserContext* browser_context, |
312 const Extension* extension, | 312 const Extension* extension, |
313 bool is_update, | 313 bool is_update, |
314 const std::string& old_name) { | 314 const std::string& old_name) { |
315 if (!ShouldMonitorStorageFor(extension)) | 315 if (!ShouldMonitorStorageFor(extension)) |
316 return; | 316 return; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 630 |
631 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 631 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
632 const std::string& extension_id, | 632 const std::string& extension_id, |
633 bool enable_notifications) { | 633 bool enable_notifications) { |
634 extension_prefs_->UpdateExtensionPref( | 634 extension_prefs_->UpdateExtensionPref( |
635 extension_id, kPrefDisableStorageNotifications, | 635 extension_id, kPrefDisableStorageNotifications, |
636 enable_notifications ? nullptr : base::MakeUnique<base::Value>(true)); | 636 enable_notifications ? nullptr : base::MakeUnique<base::Value>(true)); |
637 } | 637 } |
638 | 638 |
639 } // namespace extensions | 639 } // namespace extensions |
OLD | NEW |