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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 348313003: Create withheld permissions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 5 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/ui/webui/extensions/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.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/app_window.h" 9 #include "apps/app_window.h"
10 #include "apps/app_window_registry.h" 10 #include "apps/app_window_registry.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); 262 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app());
263 extension_data->SetBoolean("is_platform_app", extension->is_platform_app()); 263 extension_data->SetBoolean("is_platform_app", extension->is_platform_app());
264 extension_data->SetBoolean("homepageProvided", 264 extension_data->SetBoolean("homepageProvided",
265 ManifestURL::GetHomepageURL(extension).is_valid()); 265 ManifestURL::GetHomepageURL(extension).is_valid());
266 266
267 // Extensions only want all URL access if: 267 // Extensions only want all URL access if:
268 // - The feature is enabled. 268 // - The feature is enabled.
269 // - The extension has access to enough urls that we can't just let it run 269 // - The extension has access to enough urls that we can't just let it run
270 // on those specified in the permissions. 270 // on those specified in the permissions.
271 bool wants_all_urls = 271 bool wants_all_urls =
272 FeatureSwitch::scripts_require_action()->IsEnabled() && 272 extension->permissions_data()->HasWithheldImpliedAllHosts();
273 extension->permissions_data()->RequiresActionForScriptExecution(
274 extension);
275 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); 273 extension_data->SetBoolean("wantsAllUrls", wants_all_urls);
276 extension_data->SetBoolean( 274 extension_data->SetBoolean(
277 "allowAllUrls", 275 "allowAllUrls",
278 util::AllowedScriptingOnAllUrls( 276 util::AllowedScriptingOnAllUrls(
279 extension->id(), 277 extension->id(),
280 extension_service_->GetBrowserContext())); 278 extension_service_->GetBrowserContext()));
281 279
282 base::string16 location_text; 280 base::string16 location_text;
283 if (Manifest::IsPolicyLocation(extension->location())) { 281 if (Manifest::IsPolicyLocation(extension->location())) {
284 location_text = l10n_util::GetStringUTF16( 282 location_text = l10n_util::GetStringUTF16(
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 extension_service_->EnableExtension(extension_id); 1365 extension_service_->EnableExtension(extension_id);
1368 } else { 1366 } else {
1369 ExtensionErrorReporter::GetInstance()->ReportError( 1367 ExtensionErrorReporter::GetInstance()->ReportError(
1370 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1368 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1371 true); // Be noisy. 1369 true); // Be noisy.
1372 } 1370 }
1373 requirements_checker_.reset(); 1371 requirements_checker_.reset();
1374 } 1372 }
1375 1373
1376 } // namespace extensions 1374 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/permissions_updater_unittest.cc ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698