| 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/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 Loading... |
| 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 |
| OLD | NEW |