Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: chrome/browser/extensions/extension_storage_monitor.cc

Issue 382133003: Refactored ExtensionUninstallDialog to take a NativeWindow instead of a Browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 notified_extension_ids_.clear(); 540 notified_extension_ids_.clear();
541 } 541 }
542 542
543 void ExtensionStorageMonitor::ShowUninstallPrompt( 543 void ExtensionStorageMonitor::ShowUninstallPrompt(
544 const std::string& extension_id) { 544 const std::string& extension_id) {
545 const Extension* extension = GetExtensionById(context_, extension_id); 545 const Extension* extension = GetExtensionById(context_, extension_id);
546 if (!extension) 546 if (!extension)
547 return; 547 return;
548 548
549 if (!uninstall_dialog_.get()) { 549 if (!uninstall_dialog_.get()) {
550 uninstall_dialog_.reset(ExtensionUninstallDialog::Create( 550 uninstall_dialog_.reset(ExtensionUninstallDialog::CreateAsStandaloneDialog(
551 Profile::FromBrowserContext(context_), NULL, this)); 551 Profile::FromBrowserContext(context_), this));
552 } 552 }
553 553
554 uninstall_extension_id_ = extension->id(); 554 uninstall_extension_id_ = extension->id();
555 uninstall_dialog_->ConfirmUninstall(extension); 555 uninstall_dialog_->ConfirmUninstall(extension);
556 } 556 }
557 557
558 int64 ExtensionStorageMonitor::GetNextStorageThreshold( 558 int64 ExtensionStorageMonitor::GetNextStorageThreshold(
559 const std::string& extension_id) const { 559 const std::string& extension_id) const {
560 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); 560 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id);
561 if (next_threshold == 0) { 561 if (next_threshold == 0) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698