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/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
10 #include "apps/shell_window.h" | 10 #include "apps/shell_window.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 std::string extension_id = params->item_id; | 646 std::string extension_id = params->item_id; |
647 | 647 |
648 ExtensionSystem* system = ExtensionSystem::Get(profile()); | 648 ExtensionSystem* system = ExtensionSystem::Get(profile()); |
649 ManagementPolicy* management_policy = system->management_policy(); | 649 ManagementPolicy* management_policy = system->management_policy(); |
650 ExtensionService* service = profile()->GetExtensionService(); | 650 ExtensionService* service = profile()->GetExtensionService(); |
651 | 651 |
652 const Extension* extension = service->GetInstalledExtension(extension_id); | 652 const Extension* extension = service->GetInstalledExtension(extension_id); |
653 if (!extension || | 653 if (!extension || |
654 !management_policy->UserMayModifySettings(extension, NULL)) { | 654 !management_policy->UserMayModifySettings(extension, NULL)) { |
655 LOG(ERROR) << "Attempt to enable an extension that is non-usermanagable " | 655 LOG(ERROR) << "Attempt to enable an extension that is non-usermanagable " |
656 "was made. Extension id: " << extension->id(); | 656 "was made. Extension id: " << extension_id.c_str(); |
657 return false; | 657 return false; |
658 } | 658 } |
659 | 659 |
660 if (params->enable) { | 660 if (params->enable) { |
661 ExtensionPrefs* prefs = service->extension_prefs(); | 661 ExtensionPrefs* prefs = service->extension_prefs(); |
662 if (prefs->DidExtensionEscalatePermissions(extension_id)) { | 662 if (prefs->DidExtensionEscalatePermissions(extension_id)) { |
663 ShellWindowRegistry* registry = ShellWindowRegistry::Get(profile()); | 663 ShellWindowRegistry* registry = ShellWindowRegistry::Get(profile()); |
664 CHECK(registry); | 664 CHECK(registry); |
665 ShellWindow* shell_window = registry->GetShellWindowForRenderViewHost( | 665 ShellWindow* shell_window = registry->GetShellWindowForRenderViewHost( |
666 render_view_host()); | 666 render_view_host()); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 return true; | 1278 return true; |
1279 } | 1279 } |
1280 | 1280 |
1281 DeveloperPrivateIsProfileManagedFunction:: | 1281 DeveloperPrivateIsProfileManagedFunction:: |
1282 ~DeveloperPrivateIsProfileManagedFunction() { | 1282 ~DeveloperPrivateIsProfileManagedFunction() { |
1283 } | 1283 } |
1284 | 1284 |
1285 } // namespace api | 1285 } // namespace api |
1286 | 1286 |
1287 } // namespace extensions | 1287 } // namespace extensions |
OLD | NEW |