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 |
(...skipping 27 matching lines...) Expand all Loading... | |
38 Profile* profile; | 38 Profile* profile; |
39 content::WebContents* tab; | 39 content::WebContents* tab; |
40 }; | 40 }; |
41 | 41 |
42 ContentAction(); | 42 ContentAction(); |
43 | 43 |
44 virtual Type GetType() const = 0; | 44 virtual Type GetType() const = 0; |
45 | 45 |
46 // 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 |
47 // 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 |
48 // changes. | 48 // changes. Reapply exists to reapply changes to a new page, even if the |
49 // previous page also matched relevant conditions. | |
49 virtual void Apply(const std::string& extension_id, | 50 virtual void Apply(const std::string& extension_id, |
50 const base::Time& extension_install_time, | 51 const base::Time& extension_install_time, |
51 ApplyInfo* apply_info) const = 0; | 52 ApplyInfo* apply_info) const = 0; |
52 virtual void Revert(const std::string& extension_id, | 53 virtual void Revert(const std::string& extension_id, |
53 const base::Time& extension_install_time, | 54 const base::Time& extension_install_time, |
54 ApplyInfo* apply_info) const = 0; | 55 ApplyInfo* apply_info) const = 0; |
56 virtual void Reapply(const std::string& extension_id, | |
57 const base::Time& extension_install_time, | |
Devlin
2014/08/21 17:14:09
indentation.
Mark Dittmer
2014/08/21 21:25:12
Done.
| |
58 ApplyInfo* apply_info) const = 0; | |
55 | 59 |
56 // Factory method that instantiates a concrete ContentAction | 60 // Factory method that instantiates a concrete ContentAction |
57 // implementation according to |json_action|, the representation of the | 61 // implementation according to |json_action|, the representation of the |
58 // ContentAction as received from the extension API. | 62 // ContentAction as received from the extension API. |
59 // Sets |error| and returns NULL in case of a semantic error that cannot | 63 // Sets |error| and returns NULL in case of a semantic error that cannot |
60 // be caught by schema validation. Sets |bad_message| and returns NULL | 64 // be caught by schema validation. Sets |bad_message| and returns NULL |
61 // in case the input is syntactically unexpected. | 65 // in case the input is syntactically unexpected. |
62 static scoped_refptr<ContentAction> Create(const Extension* extension, | 66 static scoped_refptr<ContentAction> Create(Profile* profile, |
67 const Extension* extension, | |
63 const base::Value& json_action, | 68 const base::Value& json_action, |
64 std::string* error, | 69 std::string* error, |
65 bool* bad_message); | 70 bool* bad_message); |
66 | 71 |
67 protected: | 72 protected: |
68 friend class base::RefCounted<ContentAction>; | 73 friend class base::RefCounted<ContentAction>; |
69 virtual ~ContentAction(); | 74 virtual ~ContentAction(); |
70 }; | 75 }; |
71 | 76 |
72 typedef DeclarativeActionSet<ContentAction> ContentActionSet; | 77 typedef DeclarativeActionSet<ContentAction> ContentActionSet; |
73 | 78 |
74 } // namespace extensions | 79 } // namespace extensions |
75 | 80 |
76 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ | 81 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ |
OLD | NEW |