OLD | NEW |
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_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "chrome/browser/extensions/api/declarative/declarative_rule.h" | 12 #include "chrome/browser/extensions/api/declarative/declarative_rule.h" |
13 #include "chrome/browser/extensions/declarative_user_script_master.h" | 13 #include "chrome/browser/extensions/declarative_user_script_master.h" |
14 | 14 |
15 class Profile; | |
16 | |
17 namespace base { | 15 namespace base { |
18 class Time; | 16 class Time; |
19 class Value; | 17 class Value; |
20 } | 18 } |
21 | 19 |
22 namespace content { | 20 namespace content { |
| 21 class BrowserContext; |
23 class WebContents; | 22 class WebContents; |
24 } | 23 } |
25 | 24 |
26 namespace extensions { | 25 namespace extensions { |
27 class Extension; | 26 class Extension; |
28 | 27 |
29 // Base class for all ContentActions of the declarative content API. | 28 // Base class for all ContentActions of the declarative content API. |
30 class ContentAction : public base::RefCounted<ContentAction> { | 29 class ContentAction : public base::RefCounted<ContentAction> { |
31 public: | 30 public: |
32 // Type identifiers for concrete ContentActions. | 31 // Type identifiers for concrete ContentActions. |
33 enum Type { | 32 enum Type { |
34 ACTION_SHOW_PAGE_ACTION, | 33 ACTION_SHOW_PAGE_ACTION, |
35 ACTION_REQUEST_CONTENT_SCRIPT, | 34 ACTION_REQUEST_CONTENT_SCRIPT, |
36 }; | 35 }; |
37 | 36 |
38 struct ApplyInfo { | 37 struct ApplyInfo { |
39 Profile* profile; | 38 content::BrowserContext* browser_context; |
40 content::WebContents* tab; | 39 content::WebContents* tab; |
41 }; | 40 }; |
42 | 41 |
43 ContentAction(); | 42 ContentAction(); |
44 | 43 |
45 virtual Type GetType() const = 0; | 44 virtual Type GetType() const = 0; |
46 | 45 |
47 // Applies or reverts this ContentAction on a particular tab for a particular | 46 // Applies or reverts this ContentAction on a particular tab for a particular |
48 // extension. Revert exists to keep the actions up to date as the page | 47 // extension. Revert exists to keep the actions up to date as the page |
49 // changes. Reapply exists to reapply changes to a new page, even if the | 48 // changes. Reapply exists to reapply changes to a new page, even if the |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 DeclarativeUserScriptMaster* master_; | 151 DeclarativeUserScriptMaster* master_; |
153 | 152 |
154 DISALLOW_COPY_AND_ASSIGN(RequestContentScript); | 153 DISALLOW_COPY_AND_ASSIGN(RequestContentScript); |
155 }; | 154 }; |
156 | 155 |
157 typedef DeclarativeActionSet<ContentAction> ContentActionSet; | 156 typedef DeclarativeActionSet<ContentAction> ContentActionSet; |
158 | 157 |
159 } // namespace extensions | 158 } // namespace extensions |
160 | 159 |
161 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ | 160 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ |
OLD | NEW |