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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 2396903002: Supervised Users always need custodian approval for permission increase (Closed)
Patch Set: Remove deleted method from the header file. Created 4 years, 2 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 | chrome/browser/extensions/extension_disabled_ui.cc » ('j') | 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/webstore_private/webstore_private_api.h" 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context()); 612 ExtensionRegistry* registry = ExtensionRegistry::Get(browser_context());
613 613
614 const Extension* extension = 614 const Extension* extension =
615 registry->GetExtensionById(params->id, ExtensionRegistry::EVERYTHING); 615 registry->GetExtensionById(params->id, ExtensionRegistry::EVERYTHING);
616 if (!extension) { 616 if (!extension) {
617 return RespondNow(BuildResponse(false)); 617 return RespondNow(BuildResponse(false));
618 } 618 }
619 619
620 ExtensionPrefs* extensions_prefs = ExtensionPrefs::Get(browser_context()); 620 ExtensionPrefs* extensions_prefs = ExtensionPrefs::Get(browser_context());
621 621
622 if (extensions::util::NeedCustodianApprovalForPermissionIncrease(profile) && 622 if (extensions_prefs->HasDisableReason(
623 extensions_prefs->HasDisableReason(
624 params->id, Extension::DISABLE_PERMISSIONS_INCREASE)) { 623 params->id, Extension::DISABLE_PERMISSIONS_INCREASE)) {
625 return RespondNow(BuildResponse(true)); 624 return RespondNow(BuildResponse(true));
626 } 625 }
627 626
628 bool is_pending_approval = extensions_prefs->HasDisableReason( 627 bool is_pending_approval = extensions_prefs->HasDisableReason(
629 params->id, Extension::DISABLE_CUSTODIAN_APPROVAL_REQUIRED); 628 params->id, Extension::DISABLE_CUSTODIAN_APPROVAL_REQUIRED);
630 629
631 return RespondNow(BuildResponse(is_pending_approval)); 630 return RespondNow(BuildResponse(is_pending_approval));
632 } 631 }
633 632
634 ExtensionFunction::ResponseValue 633 ExtensionFunction::ResponseValue
635 WebstorePrivateIsPendingCustodianApprovalFunction::BuildResponse(bool result) { 634 WebstorePrivateIsPendingCustodianApprovalFunction::BuildResponse(bool result) {
636 return OneArgument(base::MakeUnique<base::FundamentalValue>(result)); 635 return OneArgument(base::MakeUnique<base::FundamentalValue>(result));
637 } 636 }
638 637
639 } // namespace extensions 638 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_disabled_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698