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

Unified Diff: chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h

Issue 10815028: Make ActiveTabPermissionManager also grant the tabs permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h
diff --git a/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h b/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h
index 7a1f519ca8b57a26356bf3b6667d12118757d7f2..fa500e1c64ad81af6356dceff471ceb29bf5acf0 100644
--- a/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h
+++ b/chrome/browser/extensions/api/tabs/execute_code_in_tab_function.h
@@ -11,6 +11,14 @@
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/extensions/user_script.h"
+namespace extensions {
+namespace api {
+namespace tabs {
+struct InjectDetails;
+} // namespace tabs
+} // namespace api
+} // namespace extensions
+
// Implement API call tabs.executeScript and tabs.insertCSS.
class ExecuteCodeInTabFunction : public AsyncExtensionFunction {
public:
@@ -20,6 +28,7 @@ class ExecuteCodeInTabFunction : public AsyncExtensionFunction {
virtual ~ExecuteCodeInTabFunction();
// ExtensionFunction:
+ virtual bool HasPermission() OVERRIDE;
virtual bool RunImpl() OVERRIDE;
// Message handler.
@@ -29,6 +38,10 @@ class ExecuteCodeInTabFunction : public AsyncExtensionFunction {
const ListValue& script_result);
private:
+ // Initialize the |execute_tab_id_| and |details_| if they haven't already
+ // been. Returns whether initialization was successful.
+ bool Init();
+
// Called when contents from the file whose path is specified in JSON
// arguments has been loaded.
void DidLoadFile(bool success, const std::string& data);
@@ -51,16 +64,12 @@ class ExecuteCodeInTabFunction : public AsyncExtensionFunction {
// Id of tab which executes code.
int execute_tab_id_;
+ // The injection details.
+ scoped_ptr<extensions::api::tabs::InjectDetails> details_;
+
// Contains extension resource built from path of file which is
// specified in JSON arguments.
ExtensionResource resource_;
-
- // If all_frames_ is true, script or CSS text would be injected
- // to all frames; Otherwise only injected to top main frame.
- bool all_frames_;
-
- // The intended time to run the script.
- extensions::UserScript::RunLocation run_at_;
};
class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction {
« no previous file with comments | « chrome/browser/extensions/active_tab_unittest.cc ('k') | chrome/browser/extensions/api/tabs/execute_code_in_tab_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698