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

Side by Side Diff: chrome/browser/extensions/api/management/management_api.cc

Issue 556723003: Terminated extensions should be uninstalled without error now. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review issues are addressed. Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/management/management_api.h" 5 #include "chrome/browser/extensions/api/management/management_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 } 592 }
593 593
594 ManagementUninstallFunctionBase::~ManagementUninstallFunctionBase() { 594 ManagementUninstallFunctionBase::~ManagementUninstallFunctionBase() {
595 } 595 }
596 596
597 bool ManagementUninstallFunctionBase::Uninstall( 597 bool ManagementUninstallFunctionBase::Uninstall(
598 const std::string& target_extension_id, 598 const std::string& target_extension_id,
599 bool show_confirm_dialog) { 599 bool show_confirm_dialog) {
600 extension_id_ = target_extension_id; 600 extension_id_ = target_extension_id;
601 const Extension* target_extension = 601 const Extension* target_extension =
602 service()->GetExtensionById(extension_id_, true); 602 extensions::ExtensionRegistry::Get(browser_context())->
603 GetExtensionById(extension_id_, ExtensionRegistry::EVERYTHING);
603 if (!target_extension || 604 if (!target_extension ||
604 ui_util::ShouldNotBeVisible(target_extension, browser_context())) { 605 ui_util::ShouldNotBeVisible(target_extension, browser_context())) {
605 error_ = ErrorUtils::FormatErrorMessage( 606 error_ = ErrorUtils::FormatErrorMessage(
606 keys::kNoExtensionError, extension_id_); 607 keys::kNoExtensionError, extension_id_);
607 return false; 608 return false;
608 } 609 }
609 610
610 if (!ExtensionSystem::Get(GetProfile()) 611 if (!ExtensionSystem::Get(GetProfile())
611 ->management_policy() 612 ->management_policy()
612 ->UserMayModifySettings(target_extension, NULL)) { 613 ->UserMayModifySettings(target_extension, NULL)) {
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 ManagementAPI::GetFactoryInstance() { 1014 ManagementAPI::GetFactoryInstance() {
1014 return g_factory.Pointer(); 1015 return g_factory.Pointer();
1015 } 1016 }
1016 1017
1017 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { 1018 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) {
1018 management_event_router_.reset(new ManagementEventRouter(browser_context_)); 1019 management_event_router_.reset(new ManagementEventRouter(browser_context_));
1019 EventRouter::Get(browser_context_)->UnregisterObserver(this); 1020 EventRouter::Get(browser_context_)->UnregisterObserver(this);
1020 } 1021 }
1021 1022
1022 } // namespace extensions 1023 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698