| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Implementation of ContentAction: | 97 // Implementation of ContentAction: |
| 98 void Apply(const ApplyInfo& apply_info) const override; | 98 void Apply(const ApplyInfo& apply_info) const override; |
| 99 void Reapply(const ApplyInfo& apply_info) const override; | 99 void Reapply(const ApplyInfo& apply_info) const override; |
| 100 void Revert(const ApplyInfo& apply_info) const override; | 100 void Revert(const ApplyInfo& apply_info) const override; |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 void InitScript(const HostID& host_id, | 103 void InitScript(const HostID& host_id, |
| 104 const Extension* extension, | 104 const Extension* extension, |
| 105 const ScriptData& script_data); | 105 const ScriptData& script_data); |
| 106 | 106 |
| 107 void AddScript() { | 107 void AddScript(); |
| 108 DCHECK(master_); | |
| 109 master_->AddScript(script_); | |
| 110 } | |
| 111 | 108 |
| 112 void InstructRenderProcessToInject(content::WebContents* contents, | 109 void InstructRenderProcessToInject(content::WebContents* contents, |
| 113 const Extension* extension) const; | 110 const Extension* extension) const; |
| 114 | 111 |
| 115 UserScript script_; | 112 UserScript script_; |
| 116 DeclarativeUserScriptMaster* master_; | 113 DeclarativeUserScriptMaster* master_; |
| 117 | 114 |
| 118 DISALLOW_COPY_AND_ASSIGN(RequestContentScript); | 115 DISALLOW_COPY_AND_ASSIGN(RequestContentScript); |
| 119 }; | 116 }; |
| 120 | 117 |
| 121 } // namespace extensions | 118 } // namespace extensions |
| 122 | 119 |
| 123 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ | 120 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_CONTENT_CONTENT_ACTION_H_ |
| OLD | NEW |