| 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_WEBREQUEST_WEBREQUEST_ACTION_H
_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H
_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H
_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H
_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const base::Time& extension_install_time) const = 0; | 140 const base::Time& extension_install_time) const = 0; |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 // Immutable container for multiple actions. | 143 // Immutable container for multiple actions. |
| 144 // | 144 // |
| 145 // TODO(battre): As WebRequestActionSet can become the single owner of all | 145 // TODO(battre): As WebRequestActionSet can become the single owner of all |
| 146 // actions, we can optimize here by making some of them singletons (e.g. Cancel | 146 // actions, we can optimize here by making some of them singletons (e.g. Cancel |
| 147 // actions). | 147 // actions). |
| 148 class WebRequestActionSet { | 148 class WebRequestActionSet { |
| 149 public: | 149 public: |
| 150 typedef std::vector<linked_ptr<json_schema_compiler::any::Any> > AnyVector; | 150 typedef std::vector<linked_ptr<base::Value> > AnyVector; |
| 151 typedef std::vector<linked_ptr<WebRequestAction> > Actions; | 151 typedef std::vector<linked_ptr<WebRequestAction> > Actions; |
| 152 | 152 |
| 153 explicit WebRequestActionSet(const Actions& actions); | 153 explicit WebRequestActionSet(const Actions& actions); |
| 154 virtual ~WebRequestActionSet(); | 154 virtual ~WebRequestActionSet(); |
| 155 | 155 |
| 156 // Factory method that instantiates a WebRequestActionSet according to | 156 // Factory method that instantiates a WebRequestActionSet according to |
| 157 // |actions| which represents the array of actions received from the | 157 // |actions| which represents the array of actions received from the |
| 158 // extension API. | 158 // extension API. |
| 159 static scoped_ptr<WebRequestActionSet> Create(const AnyVector& actions, | 159 static scoped_ptr<WebRequestActionSet> Create(const AnyVector& actions, |
| 160 std::string* error, | 160 std::string* error, |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 const base::Time& extension_install_time) const OVERRIDE; | 461 const base::Time& extension_install_time) const OVERRIDE; |
| 462 | 462 |
| 463 private: | 463 private: |
| 464 std::string message_; | 464 std::string message_; |
| 465 DISALLOW_COPY_AND_ASSIGN(WebRequestSendMessageToExtensionAction); | 465 DISALLOW_COPY_AND_ASSIGN(WebRequestSendMessageToExtensionAction); |
| 466 }; | 466 }; |
| 467 | 467 |
| 468 } // namespace extensions | 468 } // namespace extensions |
| 469 | 469 |
| 470 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTIO
N_H_ | 470 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTIO
N_H_ |
| OLD | NEW |