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

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

Issue 487913004: Only show the checkbox for all urls when the switch is on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add Test Created 6 years, 4 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
« no previous file with comments | « chrome/browser/extensions/extension_ui_unittest.cc ('k') | no next file » | 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/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_window.h" 8 #include "apps/app_window.h"
9 #include "apps/app_window_registry.h" 9 #include "apps/app_window_registry.h"
10 #include "apps/saved_files_service.h" 10 #include "apps/saved_files_service.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 } 285 }
286 extension_data->Set("dependentExtensions", dependents_list); 286 extension_data->Set("dependentExtensions", dependents_list);
287 287
288 // Extensions only want all URL access if: 288 // Extensions only want all URL access if:
289 // - The feature is enabled for the given extension. 289 // - The feature is enabled for the given extension.
290 // - The extension has access to enough urls that we can't just let it run 290 // - The extension has access to enough urls that we can't just let it run
291 // on those specified in the permissions. 291 // on those specified in the permissions.
292 bool wants_all_urls = 292 bool wants_all_urls =
293 util::ScriptsMayRequireActionForExtension(extension) && 293 util::ScriptsMayRequireActionForExtension(extension) &&
294 extension->permissions_data()->HasWithheldImpliedAllHosts(); 294 (extension->permissions_data()->HasWithheldImpliedAllHosts() ||
295 util::AllowedScriptingOnAllUrls(
296 extension->id(), extension_service_->GetBrowserContext()));
295 extension_data->SetBoolean("wantsAllUrls", wants_all_urls); 297 extension_data->SetBoolean("wantsAllUrls", wants_all_urls);
296 extension_data->SetBoolean( 298 extension_data->SetBoolean(
297 "allowAllUrls", 299 "allowAllUrls",
298 util::AllowedScriptingOnAllUrls( 300 util::AllowedScriptingOnAllUrls(
299 extension->id(), 301 extension->id(),
300 extension_service_->GetBrowserContext())); 302 extension_service_->GetBrowserContext()));
301 303
302 base::string16 location_text; 304 base::string16 location_text;
303 if (Manifest::IsPolicyLocation(extension->location())) { 305 if (Manifest::IsPolicyLocation(extension->location())) {
304 location_text = l10n_util::GetStringUTF16( 306 location_text = l10n_util::GetStringUTF16(
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 extension_service_->EnableExtension(extension_id); 1408 extension_service_->EnableExtension(extension_id);
1407 } else { 1409 } else {
1408 ExtensionErrorReporter::GetInstance()->ReportError( 1410 ExtensionErrorReporter::GetInstance()->ReportError(
1409 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1411 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1410 true); // Be noisy. 1412 true); // Be noisy.
1411 } 1413 }
1412 requirements_checker_.reset(); 1414 requirements_checker_.reset();
1413 } 1415 }
1414 1416
1415 } // namespace extensions 1417 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_ui_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698