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

Side by Side Diff: chrome/common/extensions/extension.h

Issue 10695070: Implement scriptBadge.requestToAct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iosfwd> 10 #include <iosfwd>
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // checked (using its matches list). Otherwise, permission to execute script 514 // checked (using its matches list). Otherwise, permission to execute script
515 // programmatically is checked (using the extension's host permission). 515 // programmatically is checked (using the extension's host permission).
516 // 516 //
517 // This method is also aware of certain special pages that extensions are 517 // This method is also aware of certain special pages that extensions are
518 // usually not allowed to run script on. 518 // usually not allowed to run script on.
519 bool CanExecuteScriptOnPage(const GURL& page_url, 519 bool CanExecuteScriptOnPage(const GURL& page_url,
520 int tab_id, 520 int tab_id,
521 const UserScript* script, 521 const UserScript* script,
522 std::string* error) const; 522 std::string* error) const;
523 523
524 bool CanRequestToActOnPage(const GURL& page_url,
525 int tab_id) const;
526
524 // Returns true if this extension is a COMPONENT extension, or if it is 527 // Returns true if this extension is a COMPONENT extension, or if it is
525 // on the whitelist of extensions that can script all pages. 528 // on the whitelist of extensions that can script all pages.
526 bool CanExecuteScriptEverywhere() const; 529 bool CanExecuteScriptEverywhere() const;
527 530
528 // Returns true if this extension is allowed to obtain the contents of a 531 // Returns true if this extension is allowed to obtain the contents of a
529 // page as an image. Since a page may contain sensitive information, this 532 // page as an image. Since a page may contain sensitive information, this
530 // is restricted to the extension's host permissions as well as the 533 // is restricted to the extension's host permissions as well as the
531 // extension page itself. 534 // extension page itself.
532 bool CanCaptureVisiblePage(const GURL& page_url, 535 bool CanCaptureVisiblePage(const GURL& page_url,
533 int tab_id, 536 int tab_id,
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 bool LoadOAuth2Info(string16* error); 882 bool LoadOAuth2Info(string16* error);
880 883
881 // Returns true if the extension has more than one "UI surface". For example, 884 // Returns true if the extension has more than one "UI surface". For example,
882 // an extension that has a browser action and a page action. 885 // an extension that has a browser action and a page action.
883 bool HasMultipleUISurfaces() const; 886 bool HasMultipleUISurfaces() const;
884 887
885 // Updates the launch URL and extents for the extension using the given 888 // Updates the launch URL and extents for the extension using the given
886 // |override_url|. 889 // |override_url|.
887 void OverrideLaunchUrl(const GURL& override_url); 890 void OverrideLaunchUrl(const GURL& override_url);
888 891
892 // Returns true and sets *error if page_url is too sensitive for this
893 // extension to run on it, even if it has user permission. Doesn't try to set
894 // a NULL error.
895 bool IsPageTooSensitiveForScript(const GURL& page_url,
Aaron Boodman 2012/07/03 01:29:31 Makes me think of a page that starts crying as soo
Jeffrey Yasskin 2012/07/10 21:52:33 Heh. Got a better name? ;)
896 std::string* error) const;
897
889 // Custom checks for the experimental permission that can't be expressed in 898 // Custom checks for the experimental permission that can't be expressed in
890 // _permission_features.json. 899 // _permission_features.json.
891 bool CanSpecifyExperimentalPermission() const; 900 bool CanSpecifyExperimentalPermission() const;
892 901
893 // Checks whether the host |pattern| is allowed for this extension, given API 902 // Checks whether the host |pattern| is allowed for this extension, given API
894 // permissions |permissions|. 903 // permissions |permissions|.
895 bool CanSpecifyHostPermission(const URLPattern& pattern, 904 bool CanSpecifyHostPermission(const URLPattern& pattern,
896 const APIPermissionSet& permissions) const; 905 const APIPermissionSet& permissions) const;
897 906
898 // Check that platform app features are valid. Called after InitFromValue. 907 // Check that platform app features are valid. Called after InitFromValue.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 1188
1180 UpdatedExtensionPermissionsInfo( 1189 UpdatedExtensionPermissionsInfo(
1181 const Extension* extension, 1190 const Extension* extension,
1182 const PermissionSet* permissions, 1191 const PermissionSet* permissions,
1183 Reason reason); 1192 Reason reason);
1184 }; 1193 };
1185 1194
1186 } // namespace extensions 1195 } // namespace extensions
1187 1196
1188 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ 1197 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698