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

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

Issue 173556: Implement script API:executeScript (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « no previous file | chrome/browser/extensions/execute_code_in_tab_function.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXECUTE_CODE_IN_TAB_FUNCTION_H__
6 #define CHROME_BROWSER_EXTENSIONS_EXECUTE_CODE_IN_TAB_FUNCTION_H__
7
8 #include <string>
9 #include <vector>
10
11 #include "base/file_path.h"
12 #include "chrome/browser/extensions/extension_function.h"
13 #include "chrome/common/notification_service.h"
14 #include "chrome/common/notification_registrar.h"
15
16 class MessageLoop;
17
18 // Implement API call tabs.executeScript and tabs.insertCSS.
19 class ExecuteCodeInTabFunction : public AsyncExtensionFunction,
20 public NotificationObserver {
21 public:
22 ExecuteCodeInTabFunction() : execute_tab_id_(-1), ui_loop_(NULL) {}
23
24 private:
25 virtual bool RunImpl();
26
27 virtual void Observe(NotificationType type,
28 const NotificationSource& source,
29 const NotificationDetails& details);
30
31 // Load contents from file whose path is specified in JSON arguments. Run
32 // in file thread.
33 void LoadFile();
34
35 // Run in UI thread.
36 void Execute();
37
38 NotificationRegistrar registrar_;
39
40 // Id of tab which executes code.
41 int execute_tab_id_;
42
43 MessageLoop* ui_loop_;
44
45 // Contain path of file which is specified in JSON arguments.
46 FilePath file_path_;
47
48 // Contain code to be executed.
49 std::string code_string_;
50 };
51
52 #endif // CHROME_BROWSER_EXTENSIONS_EXECUTE_CODE_IN_TAB_FUNCTION_H__
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/execute_code_in_tab_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698