Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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(GetProfile())-> |
|
Ken Rockot(use gerrit already)
2014/09/09 05:55:29
Please use browser_context() instead of GetProfile
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |