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

Side by Side Diff: chrome/browser/extensions/script_executor.h

Issue 286003004: Block tabs.executeScript() from executing until user grants permission (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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) 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_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_
6 #define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ 6 #define CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "chrome/browser/extensions/tab_helper.h" 12 #include "chrome/browser/extensions/tab_helper.h"
13 #include "extensions/common/user_script.h" 13 #include "extensions/common/user_script.h"
14 14
15 class GURL; 15 class GURL;
16 struct ExtensionMsg_ExecuteCode_Params;
16 17
17 namespace base { 18 namespace base {
18 class ListValue; 19 class ListValue;
19 } // namespace base 20 } // namespace base
20 21
21 namespace content { 22 namespace content {
22 class WebContents; 23 class WebContents;
23 } 24 }
24 25
25 namespace extensions { 26 namespace extensions {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 UserScript::RunLocation run_at, 87 UserScript::RunLocation run_at,
87 WorldType world_type, 88 WorldType world_type,
88 ProcessType process_type, 89 ProcessType process_type,
89 const GURL& webview_src, 90 const GURL& webview_src,
90 const GURL& file_url, 91 const GURL& file_url,
91 bool user_gesture, 92 bool user_gesture,
92 ResultType result_type, 93 ResultType result_type,
93 const ExecuteScriptCallback& callback); 94 const ExecuteScriptCallback& callback);
94 95
95 private: 96 private:
97 // A helper function, called upon request being given to execute the script.
not at google - send to devlin 2014/05/15 00:12:36 s/A helper function, c/C/
Devlin 2014/05/15 17:45:59 Done.
98 void ExecuteScriptHelper(const ExtensionMsg_ExecuteCode_Params& params,
99 const ExecuteScriptCallback& callback);
100
96 // The next value to use for request_id in ExtensionMsg_ExecuteCode_Params. 101 // The next value to use for request_id in ExtensionMsg_ExecuteCode_Params.
97 int next_request_id_; 102 int next_request_id_;
98 103
99 content::WebContents* web_contents_; 104 content::WebContents* web_contents_;
100 105
101 ObserverList<TabHelper::ScriptExecutionObserver>* script_observers_; 106 ObserverList<TabHelper::ScriptExecutionObserver>* script_observers_;
102 }; 107 };
103 108
104 } // namespace extensions 109 } // namespace extensions
105 110
106 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_ 111 #endif // CHROME_BROWSER_EXTENSIONS_SCRIPT_EXECUTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698