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

Side by Side Diff: extensions/common/permissions/permissions_data.cc

Issue 270153004: Introduce ActiveScriptController; track active extension scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: UMA Created 6 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "extensions/common/permissions/permissions_data.h" 5 #include "extensions/common/permissions/permissions_data.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 if (error) 553 if (error)
554 *error = errors::kActiveTabPermissionNotGranted; 554 *error = errors::kActiveTabPermissionNotGranted;
555 return false; 555 return false;
556 } 556 }
557 557
558 if (error) 558 if (error)
559 *error = errors::kAllURLOrActiveTabNeeded; 559 *error = errors::kAllURLOrActiveTabNeeded;
560 return false; 560 return false;
561 } 561 }
562 562
563 // static
564 bool PermissionsData::ShouldNotifyForScriptExecution(
565 const Extension* extension) {
566 // For now, the user should be notified when an extension with all hosts
not at google - send to devlin 2014/05/07 22:49:02 When this changes the name will no longer be appro
Devlin 2014/05/08 18:15:46 Yeah, I was just planning on changing it when the
not at google - send to devlin 2014/05/08 20:47:09 whatever matches the flag name.
567 // permission tries to execute a script on a page.
568 return HasEffectiveAccessToAllHosts(extension);
569 }
570
563 bool PermissionsData::ParsePermissions(Extension* extension, 571 bool PermissionsData::ParsePermissions(Extension* extension,
564 base::string16* error) { 572 base::string16* error) {
565 initial_required_permissions_.reset(new InitialPermissions); 573 initial_required_permissions_.reset(new InitialPermissions);
566 if (!ParseHelper(extension, 574 if (!ParseHelper(extension,
567 keys::kPermissions, 575 keys::kPermissions,
568 &initial_required_permissions_->api_permissions, 576 &initial_required_permissions_->api_permissions,
569 &initial_required_permissions_->host_permissions, 577 &initial_required_permissions_->host_permissions,
570 error)) { 578 error)) {
571 return false; 579 return false;
572 } 580 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 initial_optional_permissions_->api_permissions, 613 initial_optional_permissions_->api_permissions,
606 initial_optional_permissions_->manifest_permissions, 614 initial_optional_permissions_->manifest_permissions,
607 initial_optional_permissions_->host_permissions, 615 initial_optional_permissions_->host_permissions,
608 URLPatternSet()); 616 URLPatternSet());
609 617
610 initial_required_permissions_.reset(); 618 initial_required_permissions_.reset();
611 initial_optional_permissions_.reset(); 619 initial_optional_permissions_.reset();
612 } 620 }
613 621
614 } // namespace extensions 622 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698