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 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 uninstall_extension_id_); | 314 uninstall_extension_id_); |
315 uninstall_extension_id_.clear(); | 315 uninstall_extension_id_.clear(); |
316 if (!extension) | 316 if (!extension) |
317 return; | 317 return; |
318 | 318 |
319 ExtensionService* service = | 319 ExtensionService* service = |
320 ExtensionSystem::Get(context_)->extension_service(); | 320 ExtensionSystem::Get(context_)->extension_service(); |
321 DCHECK(service); | 321 DCHECK(service); |
322 service->UninstallExtension( | 322 service->UninstallExtension( |
323 extension->id(), | 323 extension->id(), |
324 ExtensionService::UNINSTALL_REASON_STORAGE_THRESHOLD_EXCEEDED, | 324 UninstalledExtensionInfo::REASON_STORAGE_THRESHOLD_EXCEEDED, |
325 NULL); | 325 NULL); |
326 } | 326 } |
327 | 327 |
328 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { | 328 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { |
329 uninstall_extension_id_.clear(); | 329 uninstall_extension_id_.clear(); |
330 } | 330 } |
331 | 331 |
332 std::string ExtensionStorageMonitor::GetNotificationId( | 332 std::string ExtensionStorageMonitor::GetNotificationId( |
333 const std::string& extension_id) { | 333 const std::string& extension_id) { |
334 std::vector<std::string> placeholders; | 334 std::vector<std::string> placeholders; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 609 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
610 const std::string& extension_id, | 610 const std::string& extension_id, |
611 bool enable_notifications) { | 611 bool enable_notifications) { |
612 extension_prefs_->UpdateExtensionPref( | 612 extension_prefs_->UpdateExtensionPref( |
613 extension_id, | 613 extension_id, |
614 kPrefDisableStorageNotifications, | 614 kPrefDisableStorageNotifications, |
615 enable_notifications ? NULL : new base::FundamentalValue(true)); | 615 enable_notifications ? NULL : new base::FundamentalValue(true)); |
616 } | 616 } |
617 | 617 |
618 } // namespace extensions | 618 } // namespace extensions |
OLD | NEW |