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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 156843004: Remove ExtensionService::extension_prefs() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: additional cleanup Created 6 years, 10 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 (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 30 matching lines...) Expand all
41 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 41 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
42 #include "chrome/common/extensions/manifest_url_handler.h" 42 #include "chrome/common/extensions/manifest_url_handler.h"
43 #include "chrome/common/url_constants.h" 43 #include "chrome/common/url_constants.h"
44 #include "content/public/browser/browser_thread.h" 44 #include "content/public/browser/browser_thread.h"
45 #include "content/public/browser/notification_service.h" 45 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/render_process_host.h" 46 #include "content/public/browser/render_process_host.h"
47 #include "content/public/browser/render_view_host.h" 47 #include "content/public/browser/render_view_host.h"
48 #include "content/public/browser/site_instance.h" 48 #include "content/public/browser/site_instance.h"
49 #include "content/public/browser/storage_partition.h" 49 #include "content/public/browser/storage_partition.h"
50 #include "content/public/browser/web_contents.h" 50 #include "content/public/browser/web_contents.h"
51 #include "extensions/browser/extension_prefs.h"
51 #include "extensions/browser/extension_registry.h" 52 #include "extensions/browser/extension_registry.h"
52 #include "extensions/browser/extension_system.h" 53 #include "extensions/browser/extension_system.h"
53 #include "extensions/browser/management_policy.h" 54 #include "extensions/browser/management_policy.h"
54 #include "extensions/browser/view_type_utils.h" 55 #include "extensions/browser/view_type_utils.h"
55 #include "extensions/common/constants.h" 56 #include "extensions/common/constants.h"
56 #include "extensions/common/extension_resource.h" 57 #include "extensions/common/extension_resource.h"
57 #include "extensions/common/extension_set.h" 58 #include "extensions/common/extension_set.h"
58 #include "extensions/common/install_warning.h" 59 #include "extensions/common/install_warning.h"
59 #include "extensions/common/manifest_handlers/background_info.h" 60 #include "extensions/common/manifest_handlers/background_info.h"
60 #include "extensions/common/manifest_handlers/incognito_info.h" 61 #include "extensions/common/manifest_handlers/incognito_info.h"
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 bool enable = params->enable; 703 bool enable = params->enable;
703 if (!policy->UserMayModifySettings(extension, NULL) || 704 if (!policy->UserMayModifySettings(extension, NULL) ||
704 (!enable && policy->MustRemainEnabled(extension, NULL)) || 705 (!enable && policy->MustRemainEnabled(extension, NULL)) ||
705 (enable && policy->MustRemainDisabled(extension, NULL, NULL))) { 706 (enable && policy->MustRemainDisabled(extension, NULL, NULL))) {
706 LOG(ERROR) << "Attempt to change enable state denied by management policy. " 707 LOG(ERROR) << "Attempt to change enable state denied by management policy. "
707 << "Extension id: " << extension_id.c_str(); 708 << "Extension id: " << extension_id.c_str();
708 return false; 709 return false;
709 } 710 }
710 711
711 if (enable) { 712 if (enable) {
712 ExtensionPrefs* prefs = service->extension_prefs(); 713 ExtensionPrefs* prefs = ExtensionPrefs::Get(GetProfile());
713 if (prefs->DidExtensionEscalatePermissions(extension_id)) { 714 if (prefs->DidExtensionEscalatePermissions(extension_id)) {
714 ShellWindowRegistry* registry = ShellWindowRegistry::Get(GetProfile()); 715 ShellWindowRegistry* registry = ShellWindowRegistry::Get(GetProfile());
715 CHECK(registry); 716 CHECK(registry);
716 ShellWindow* shell_window = registry->GetShellWindowForRenderViewHost( 717 ShellWindow* shell_window = registry->GetShellWindowForRenderViewHost(
717 render_view_host()); 718 render_view_host());
718 if (!shell_window) { 719 if (!shell_window) {
719 return false; 720 return false;
720 } 721 }
721 722
722 ShowExtensionDisabledDialog( 723 ShowExtensionDisabledDialog(
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 return true; 1327 return true;
1327 } 1328 }
1328 1329
1329 DeveloperPrivateIsProfileManagedFunction:: 1330 DeveloperPrivateIsProfileManagedFunction::
1330 ~DeveloperPrivateIsProfileManagedFunction() { 1331 ~DeveloperPrivateIsProfileManagedFunction() {
1331 } 1332 }
1332 1333
1333 } // namespace api 1334 } // namespace api
1334 1335
1335 } // namespace extensions 1336 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698