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

Unified Diff: chrome/browser/extensions/extension_chrome_auth_private_api.cc

Issue 9317013: Add a centralized mechanism for whitelisting access to extension permissions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_chrome_auth_private_api.cc
diff --git a/chrome/browser/extensions/extension_chrome_auth_private_api.cc b/chrome/browser/extensions/extension_chrome_auth_private_api.cc
index 1f4e6db5fae268be6773dd74a65d8c476f289ec4..5a9a54d0df06cd2cf0ad2eb5fb86330cce656e50 100644
--- a/chrome/browser/extensions/extension_chrome_auth_private_api.cc
+++ b/chrome/browser/extensions/extension_chrome_auth_private_api.cc
@@ -13,24 +13,8 @@
namespace {
-bool IsCloudPrintEnableURL(Profile* profile, const GURL& url) {
- ExtensionService* service = profile->GetExtensionService();
- const Extension* cloud_print_app = service->GetExtensionById(
- extension_misc::kCloudPrintAppId, false);
- if (!cloud_print_app) {
-#if !defined(OS_CHROMEOS)
- NOTREACHED();
-#endif // !defined(OS_CHROMEOS)
- return false;
- }
- return (service->extensions()->GetHostedAppByURL(ExtensionURLInfo(url)) ==
- cloud_print_app);
-}
-
bool test_mode = false;
-const char kAccessDeniedError[] =
- "Cannot call this API from a non-cloudprint URL.";
} // namespace
SetCloudPrintCredentialsFunction::SetCloudPrintCredentialsFunction() {
@@ -40,12 +24,6 @@ SetCloudPrintCredentialsFunction::~SetCloudPrintCredentialsFunction() {
}
bool SetCloudPrintCredentialsFunction::RunImpl() {
- // This has to be called from the specific cloud print app.
- if (!IsCloudPrintEnableURL(profile_, source_url())) {
- error_ = kAccessDeniedError;
- return false;
- }
-
std::string user_email;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &user_email));
std::string robot_email;

Powered by Google App Engine
This is Rietveld 408576698