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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 263 |
264 private: | 264 private: |
265 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToEmptyDocumentAction); | 265 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToEmptyDocumentAction); |
266 }; | 266 }; |
267 | 267 |
268 // Action that instructs to redirect a network request. | 268 // Action that instructs to redirect a network request. |
269 class WebRequestRedirectByRegExAction : public WebRequestAction { | 269 class WebRequestRedirectByRegExAction : public WebRequestAction { |
270 public: | 270 public: |
271 // The |to_pattern| has to be passed in RE2 syntax with the exception that | 271 // The |to_pattern| has to be passed in RE2 syntax with the exception that |
272 // capture groups are referenced in Perl style ($1, $2, ...). | 272 // capture groups are referenced in Perl style ($1, $2, ...). |
273 explicit WebRequestRedirectByRegExAction(scoped_ptr<re2::RE2> from_pattern, | 273 WebRequestRedirectByRegExAction(scoped_ptr<re2::RE2> from_pattern, |
274 const std::string& to_pattern); | 274 const std::string& to_pattern); |
275 virtual ~WebRequestRedirectByRegExAction(); | 275 virtual ~WebRequestRedirectByRegExAction(); |
276 | 276 |
277 // Conversion of capture group styles between Perl style ($1, $2, ...) and | 277 // Conversion of capture group styles between Perl style ($1, $2, ...) and |
278 // RE2 (\1, \2, ...). | 278 // RE2 (\1, \2, ...). |
279 static std::string PerlToRe2Style(const std::string& perl); | 279 static std::string PerlToRe2Style(const std::string& perl); |
280 | 280 |
281 // Implementation of WebRequestAction: | 281 // Implementation of WebRequestAction: |
282 virtual int GetStages() const OVERRIDE; | 282 virtual int GetStages() const OVERRIDE; |
283 virtual Type GetType() const OVERRIDE; | 283 virtual Type GetType() const OVERRIDE; |
284 virtual HostPermissionsStrategy GetHostPermissionsStrategy() const OVERRIDE; | 284 virtual HostPermissionsStrategy GetHostPermissionsStrategy() const OVERRIDE; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 private: | 352 private: |
353 std::string name_; | 353 std::string name_; |
354 std::string value_; | 354 std::string value_; |
355 DISALLOW_COPY_AND_ASSIGN(WebRequestAddResponseHeaderAction); | 355 DISALLOW_COPY_AND_ASSIGN(WebRequestAddResponseHeaderAction); |
356 }; | 356 }; |
357 | 357 |
358 // Action that instructs to remove a response header. | 358 // Action that instructs to remove a response header. |
359 class WebRequestRemoveResponseHeaderAction : public WebRequestAction { | 359 class WebRequestRemoveResponseHeaderAction : public WebRequestAction { |
360 public: | 360 public: |
361 explicit WebRequestRemoveResponseHeaderAction(const std::string& name, | 361 WebRequestRemoveResponseHeaderAction(const std::string& name, |
362 const std::string& value, | 362 const std::string& value, |
363 bool has_value); | 363 bool has_value); |
364 virtual ~WebRequestRemoveResponseHeaderAction(); | 364 virtual ~WebRequestRemoveResponseHeaderAction(); |
365 | 365 |
366 // Implementation of WebRequestAction: | 366 // Implementation of WebRequestAction: |
367 virtual int GetStages() const OVERRIDE; | 367 virtual int GetStages() const OVERRIDE; |
368 virtual Type GetType() const OVERRIDE; | 368 virtual Type GetType() const OVERRIDE; |
369 virtual LinkedPtrEventResponseDelta CreateDelta( | 369 virtual LinkedPtrEventResponseDelta CreateDelta( |
370 const WebRequestRule::RequestData& request_data, | 370 const WebRequestRule::RequestData& request_data, |
371 const std::string& extension_id, | 371 const std::string& extension_id, |
372 const base::Time& extension_install_time) const OVERRIDE; | 372 const base::Time& extension_install_time) const OVERRIDE; |
373 | 373 |
(...skipping 87 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 |