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

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

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code 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
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 const Extension* extension = GetExtensionById(context_, 313 const Extension* extension = GetExtensionById(context_,
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(extension->id(), false, NULL); 322 service->UninstallExtension(
323 extension->id(),
324 ExtensionService::UNINSTALL_REASON_STORAGE_THRESHOLD_EXCEEDED,
325 NULL);
323 } 326 }
324 327
325 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { 328 void ExtensionStorageMonitor::ExtensionUninstallCanceled() {
326 uninstall_extension_id_.clear(); 329 uninstall_extension_id_.clear();
327 } 330 }
328 331
329 std::string ExtensionStorageMonitor::GetNotificationId( 332 std::string ExtensionStorageMonitor::GetNotificationId(
330 const std::string& extension_id) { 333 const std::string& extension_id) {
331 std::vector<std::string> placeholders; 334 std::vector<std::string> placeholders;
332 placeholders.push_back(context_->GetPath().BaseName().MaybeAsASCII()); 335 placeholders.push_back(context_->GetPath().BaseName().MaybeAsASCII());
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 void ExtensionStorageMonitor::SetStorageNotificationEnabled( 609 void ExtensionStorageMonitor::SetStorageNotificationEnabled(
607 const std::string& extension_id, 610 const std::string& extension_id,
608 bool enable_notifications) { 611 bool enable_notifications) {
609 extension_prefs_->UpdateExtensionPref( 612 extension_prefs_->UpdateExtensionPref(
610 extension_id, 613 extension_id,
611 kPrefDisableStorageNotifications, 614 kPrefDisableStorageNotifications,
612 enable_notifications ? NULL : new base::FundamentalValue(true)); 615 enable_notifications ? NULL : new base::FundamentalValue(true));
613 } 616 }
614 617
615 } // namespace extensions 618 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698