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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 notified_extension_ids_.clear(); | 542 notified_extension_ids_.clear(); |
543 } | 543 } |
544 | 544 |
545 void ExtensionStorageMonitor::ShowUninstallPrompt( | 545 void ExtensionStorageMonitor::ShowUninstallPrompt( |
546 const std::string& extension_id) { | 546 const std::string& extension_id) { |
547 const Extension* extension = GetExtensionById(context_, extension_id); | 547 const Extension* extension = GetExtensionById(context_, extension_id); |
548 if (!extension) | 548 if (!extension) |
549 return; | 549 return; |
550 | 550 |
551 if (!uninstall_dialog_.get()) { | 551 if (!uninstall_dialog_.get()) { |
552 uninstall_dialog_.reset(ExtensionUninstallDialog::Create( | 552 uninstall_dialog_.reset(ExtensionUninstallDialog::CreateModal( |
553 Profile::FromBrowserContext(context_), NULL, this)); | 553 Profile::FromBrowserContext(context_), NULL, this)); |
554 } | 554 } |
555 | 555 |
556 uninstall_extension_id_ = extension->id(); | 556 uninstall_extension_id_ = extension->id(); |
557 uninstall_dialog_->ConfirmUninstall(extension); | 557 uninstall_dialog_->ConfirmUninstall(extension); |
558 } | 558 } |
559 | 559 |
560 int64 ExtensionStorageMonitor::GetNextStorageThreshold( | 560 int64 ExtensionStorageMonitor::GetNextStorageThreshold( |
561 const std::string& extension_id) const { | 561 const std::string& extension_id) const { |
562 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); | 562 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 611 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
612 const std::string& extension_id, | 612 const std::string& extension_id, |
613 bool enable_notifications) { | 613 bool enable_notifications) { |
614 extension_prefs_->UpdateExtensionPref( | 614 extension_prefs_->UpdateExtensionPref( |
615 extension_id, | 615 extension_id, |
616 kPrefDisableStorageNotifications, | 616 kPrefDisableStorageNotifications, |
617 enable_notifications ? NULL : new base::FundamentalValue(true)); | 617 enable_notifications ? NULL : new base::FundamentalValue(true)); |
618 } | 618 } |
619 | 619 |
620 } // namespace extensions | 620 } // namespace extensions |
OLD | NEW |