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

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

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 Manifest::IsUnpackedLocation(extension->location())); 253 Manifest::IsUnpackedLocation(extension->location()));
254 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app()); 254 extension_data->SetBoolean("is_hosted_app", extension->is_hosted_app());
255 extension_data->SetBoolean("is_platform_app", extension->is_platform_app()); 255 extension_data->SetBoolean("is_platform_app", extension->is_platform_app());
256 extension_data->SetBoolean("homepageProvided", 256 extension_data->SetBoolean("homepageProvided",
257 ManifestURL::GetHomepageURL(extension).is_valid()); 257 ManifestURL::GetHomepageURL(extension).is_valid());
258 258
259 // Extensions only want all URL access if: 259 // Extensions only want all URL access if:
260 // - The feature is enabled. 260 // - The feature is enabled.
261 // - The extension has access to enough urls that we can't just let it run 261 // - The extension has access to enough urls that we can't just let it run
262 // on those specified in the permissions. 262 // on those specified in the permissions.
263 bool wants_all_urls = 263 bool wants_all_urls = FeatureSwitch::scripts_require_action()->IsEnabled() &&
264 FeatureSwitch::scripts_require_action()->IsEnabled() && 264 PermissionsData::ForExtension(extension)
265 PermissionsData::RequiresActionForScriptExecution(extension); 265 ->RequiresActionForScriptExecution(extension);
266 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); 266 extension_data->SetBoolean("wantsAllUrls", wants_all_urls);
267 extension_data->SetBoolean( 267 extension_data->SetBoolean(
268 "allowAllUrls", 268 "allowAllUrls",
269 util::AllowedScriptingOnAllUrls( 269 util::AllowedScriptingOnAllUrls(
270 extension->id(), 270 extension->id(),
271 extension_service_->GetBrowserContext())); 271 extension_service_->GetBrowserContext()));
272 272
273 base::string16 location_text; 273 base::string16 location_text;
274 if (Manifest::IsPolicyLocation(extension->location())) { 274 if (Manifest::IsPolicyLocation(extension->location())) {
275 location_text = l10n_util::GetStringUTF16( 275 location_text = l10n_util::GetStringUTF16(
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 extension_service_->EnableExtension(extension_id); 1319 extension_service_->EnableExtension(extension_id);
1320 } else { 1320 } else {
1321 ExtensionErrorReporter::GetInstance()->ReportError( 1321 ExtensionErrorReporter::GetInstance()->ReportError(
1322 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1322 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1323 true); // Be noisy. 1323 true); // Be noisy.
1324 } 1324 }
1325 requirements_checker_.reset(); 1325 requirements_checker_.reset();
1326 } 1326 }
1327 1327
1328 } // namespace extensions 1328 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698