| 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 EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H_ |
| 6 #define EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H_ | 6 #define EXTENSIONS_BROWSER_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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // | 181 // |
| 182 // The following are concrete actions. | 182 // The following are concrete actions. |
| 183 // | 183 // |
| 184 | 184 |
| 185 // Action that instructs to cancel a network request. | 185 // Action that instructs to cancel a network request. |
| 186 class WebRequestCancelAction : public WebRequestAction { | 186 class WebRequestCancelAction : public WebRequestAction { |
| 187 public: | 187 public: |
| 188 WebRequestCancelAction(); | 188 WebRequestCancelAction(); |
| 189 | 189 |
| 190 // Implementation of WebRequestAction: | 190 // Implementation of WebRequestAction: |
| 191 virtual std::string GetName() const OVERRIDE; | 191 virtual std::string GetName() const override; |
| 192 virtual LinkedPtrEventResponseDelta CreateDelta( | 192 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 193 const WebRequestData& request_data, | 193 const WebRequestData& request_data, |
| 194 const std::string& extension_id, | 194 const std::string& extension_id, |
| 195 const base::Time& extension_install_time) const OVERRIDE; | 195 const base::Time& extension_install_time) const override; |
| 196 | 196 |
| 197 private: | 197 private: |
| 198 virtual ~WebRequestCancelAction(); | 198 virtual ~WebRequestCancelAction(); |
| 199 DISALLOW_COPY_AND_ASSIGN(WebRequestCancelAction); | 199 DISALLOW_COPY_AND_ASSIGN(WebRequestCancelAction); |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 // Action that instructs to redirect a network request. | 202 // Action that instructs to redirect a network request. |
| 203 class WebRequestRedirectAction : public WebRequestAction { | 203 class WebRequestRedirectAction : public WebRequestAction { |
| 204 public: | 204 public: |
| 205 explicit WebRequestRedirectAction(const GURL& redirect_url); | 205 explicit WebRequestRedirectAction(const GURL& redirect_url); |
| 206 | 206 |
| 207 // Implementation of WebRequestAction: | 207 // Implementation of WebRequestAction: |
| 208 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 208 virtual bool Equals(const WebRequestAction* other) const override; |
| 209 virtual std::string GetName() const OVERRIDE; | 209 virtual std::string GetName() const override; |
| 210 virtual LinkedPtrEventResponseDelta CreateDelta( | 210 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 211 const WebRequestData& request_data, | 211 const WebRequestData& request_data, |
| 212 const std::string& extension_id, | 212 const std::string& extension_id, |
| 213 const base::Time& extension_install_time) const OVERRIDE; | 213 const base::Time& extension_install_time) const override; |
| 214 | 214 |
| 215 private: | 215 private: |
| 216 virtual ~WebRequestRedirectAction(); | 216 virtual ~WebRequestRedirectAction(); |
| 217 | 217 |
| 218 GURL redirect_url_; // Target to which the request shall be redirected. | 218 GURL redirect_url_; // Target to which the request shall be redirected. |
| 219 | 219 |
| 220 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectAction); | 220 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectAction); |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 // Action that instructs to redirect a network request to a transparent image. | 223 // Action that instructs to redirect a network request to a transparent image. |
| 224 class WebRequestRedirectToTransparentImageAction : public WebRequestAction { | 224 class WebRequestRedirectToTransparentImageAction : public WebRequestAction { |
| 225 public: | 225 public: |
| 226 WebRequestRedirectToTransparentImageAction(); | 226 WebRequestRedirectToTransparentImageAction(); |
| 227 | 227 |
| 228 // Implementation of WebRequestAction: | 228 // Implementation of WebRequestAction: |
| 229 virtual std::string GetName() const OVERRIDE; | 229 virtual std::string GetName() const override; |
| 230 virtual LinkedPtrEventResponseDelta CreateDelta( | 230 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 231 const WebRequestData& request_data, | 231 const WebRequestData& request_data, |
| 232 const std::string& extension_id, | 232 const std::string& extension_id, |
| 233 const base::Time& extension_install_time) const OVERRIDE; | 233 const base::Time& extension_install_time) const override; |
| 234 | 234 |
| 235 private: | 235 private: |
| 236 virtual ~WebRequestRedirectToTransparentImageAction(); | 236 virtual ~WebRequestRedirectToTransparentImageAction(); |
| 237 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToTransparentImageAction); | 237 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToTransparentImageAction); |
| 238 }; | 238 }; |
| 239 | 239 |
| 240 | 240 |
| 241 // Action that instructs to redirect a network request to an empty document. | 241 // Action that instructs to redirect a network request to an empty document. |
| 242 class WebRequestRedirectToEmptyDocumentAction : public WebRequestAction { | 242 class WebRequestRedirectToEmptyDocumentAction : public WebRequestAction { |
| 243 public: | 243 public: |
| 244 WebRequestRedirectToEmptyDocumentAction(); | 244 WebRequestRedirectToEmptyDocumentAction(); |
| 245 | 245 |
| 246 // Implementation of WebRequestAction: | 246 // Implementation of WebRequestAction: |
| 247 virtual std::string GetName() const OVERRIDE; | 247 virtual std::string GetName() const override; |
| 248 virtual LinkedPtrEventResponseDelta CreateDelta( | 248 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 249 const WebRequestData& request_data, | 249 const WebRequestData& request_data, |
| 250 const std::string& extension_id, | 250 const std::string& extension_id, |
| 251 const base::Time& extension_install_time) const OVERRIDE; | 251 const base::Time& extension_install_time) const override; |
| 252 | 252 |
| 253 private: | 253 private: |
| 254 virtual ~WebRequestRedirectToEmptyDocumentAction(); | 254 virtual ~WebRequestRedirectToEmptyDocumentAction(); |
| 255 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToEmptyDocumentAction); | 255 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectToEmptyDocumentAction); |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 // Action that instructs to redirect a network request. | 258 // Action that instructs to redirect a network request. |
| 259 class WebRequestRedirectByRegExAction : public WebRequestAction { | 259 class WebRequestRedirectByRegExAction : public WebRequestAction { |
| 260 public: | 260 public: |
| 261 // The |to_pattern| has to be passed in RE2 syntax with the exception that | 261 // The |to_pattern| has to be passed in RE2 syntax with the exception that |
| 262 // capture groups are referenced in Perl style ($1, $2, ...). | 262 // capture groups are referenced in Perl style ($1, $2, ...). |
| 263 explicit WebRequestRedirectByRegExAction(scoped_ptr<re2::RE2> from_pattern, | 263 explicit WebRequestRedirectByRegExAction(scoped_ptr<re2::RE2> from_pattern, |
| 264 const std::string& to_pattern); | 264 const std::string& to_pattern); |
| 265 | 265 |
| 266 // Conversion of capture group styles between Perl style ($1, $2, ...) and | 266 // Conversion of capture group styles between Perl style ($1, $2, ...) and |
| 267 // RE2 (\1, \2, ...). | 267 // RE2 (\1, \2, ...). |
| 268 static std::string PerlToRe2Style(const std::string& perl); | 268 static std::string PerlToRe2Style(const std::string& perl); |
| 269 | 269 |
| 270 // Implementation of WebRequestAction: | 270 // Implementation of WebRequestAction: |
| 271 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 271 virtual bool Equals(const WebRequestAction* other) const override; |
| 272 virtual std::string GetName() const OVERRIDE; | 272 virtual std::string GetName() const override; |
| 273 virtual LinkedPtrEventResponseDelta CreateDelta( | 273 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 274 const WebRequestData& request_data, | 274 const WebRequestData& request_data, |
| 275 const std::string& extension_id, | 275 const std::string& extension_id, |
| 276 const base::Time& extension_install_time) const OVERRIDE; | 276 const base::Time& extension_install_time) const override; |
| 277 | 277 |
| 278 private: | 278 private: |
| 279 virtual ~WebRequestRedirectByRegExAction(); | 279 virtual ~WebRequestRedirectByRegExAction(); |
| 280 | 280 |
| 281 scoped_ptr<re2::RE2> from_pattern_; | 281 scoped_ptr<re2::RE2> from_pattern_; |
| 282 std::string to_pattern_; | 282 std::string to_pattern_; |
| 283 | 283 |
| 284 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectByRegExAction); | 284 DISALLOW_COPY_AND_ASSIGN(WebRequestRedirectByRegExAction); |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 // Action that instructs to set a request header. | 287 // Action that instructs to set a request header. |
| 288 class WebRequestSetRequestHeaderAction : public WebRequestAction { | 288 class WebRequestSetRequestHeaderAction : public WebRequestAction { |
| 289 public: | 289 public: |
| 290 WebRequestSetRequestHeaderAction(const std::string& name, | 290 WebRequestSetRequestHeaderAction(const std::string& name, |
| 291 const std::string& value); | 291 const std::string& value); |
| 292 | 292 |
| 293 // Implementation of WebRequestAction: | 293 // Implementation of WebRequestAction: |
| 294 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 294 virtual bool Equals(const WebRequestAction* other) const override; |
| 295 virtual std::string GetName() const OVERRIDE; | 295 virtual std::string GetName() const override; |
| 296 virtual LinkedPtrEventResponseDelta CreateDelta( | 296 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 297 const WebRequestData& request_data, | 297 const WebRequestData& request_data, |
| 298 const std::string& extension_id, | 298 const std::string& extension_id, |
| 299 const base::Time& extension_install_time) const OVERRIDE; | 299 const base::Time& extension_install_time) const override; |
| 300 | 300 |
| 301 private: | 301 private: |
| 302 virtual ~WebRequestSetRequestHeaderAction(); | 302 virtual ~WebRequestSetRequestHeaderAction(); |
| 303 | 303 |
| 304 std::string name_; | 304 std::string name_; |
| 305 std::string value_; | 305 std::string value_; |
| 306 DISALLOW_COPY_AND_ASSIGN(WebRequestSetRequestHeaderAction); | 306 DISALLOW_COPY_AND_ASSIGN(WebRequestSetRequestHeaderAction); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 // Action that instructs to remove a request header. | 309 // Action that instructs to remove a request header. |
| 310 class WebRequestRemoveRequestHeaderAction : public WebRequestAction { | 310 class WebRequestRemoveRequestHeaderAction : public WebRequestAction { |
| 311 public: | 311 public: |
| 312 explicit WebRequestRemoveRequestHeaderAction(const std::string& name); | 312 explicit WebRequestRemoveRequestHeaderAction(const std::string& name); |
| 313 | 313 |
| 314 // Implementation of WebRequestAction: | 314 // Implementation of WebRequestAction: |
| 315 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 315 virtual bool Equals(const WebRequestAction* other) const override; |
| 316 virtual std::string GetName() const OVERRIDE; | 316 virtual std::string GetName() const override; |
| 317 virtual LinkedPtrEventResponseDelta CreateDelta( | 317 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 318 const WebRequestData& request_data, | 318 const WebRequestData& request_data, |
| 319 const std::string& extension_id, | 319 const std::string& extension_id, |
| 320 const base::Time& extension_install_time) const OVERRIDE; | 320 const base::Time& extension_install_time) const override; |
| 321 | 321 |
| 322 private: | 322 private: |
| 323 virtual ~WebRequestRemoveRequestHeaderAction(); | 323 virtual ~WebRequestRemoveRequestHeaderAction(); |
| 324 | 324 |
| 325 std::string name_; | 325 std::string name_; |
| 326 DISALLOW_COPY_AND_ASSIGN(WebRequestRemoveRequestHeaderAction); | 326 DISALLOW_COPY_AND_ASSIGN(WebRequestRemoveRequestHeaderAction); |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 // Action that instructs to add a response header. | 329 // Action that instructs to add a response header. |
| 330 class WebRequestAddResponseHeaderAction : public WebRequestAction { | 330 class WebRequestAddResponseHeaderAction : public WebRequestAction { |
| 331 public: | 331 public: |
| 332 WebRequestAddResponseHeaderAction(const std::string& name, | 332 WebRequestAddResponseHeaderAction(const std::string& name, |
| 333 const std::string& value); | 333 const std::string& value); |
| 334 | 334 |
| 335 // Implementation of WebRequestAction: | 335 // Implementation of WebRequestAction: |
| 336 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 336 virtual bool Equals(const WebRequestAction* other) const override; |
| 337 virtual std::string GetName() const OVERRIDE; | 337 virtual std::string GetName() const override; |
| 338 virtual LinkedPtrEventResponseDelta CreateDelta( | 338 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 339 const WebRequestData& request_data, | 339 const WebRequestData& request_data, |
| 340 const std::string& extension_id, | 340 const std::string& extension_id, |
| 341 const base::Time& extension_install_time) const OVERRIDE; | 341 const base::Time& extension_install_time) const override; |
| 342 | 342 |
| 343 private: | 343 private: |
| 344 virtual ~WebRequestAddResponseHeaderAction(); | 344 virtual ~WebRequestAddResponseHeaderAction(); |
| 345 | 345 |
| 346 std::string name_; | 346 std::string name_; |
| 347 std::string value_; | 347 std::string value_; |
| 348 DISALLOW_COPY_AND_ASSIGN(WebRequestAddResponseHeaderAction); | 348 DISALLOW_COPY_AND_ASSIGN(WebRequestAddResponseHeaderAction); |
| 349 }; | 349 }; |
| 350 | 350 |
| 351 // Action that instructs to remove a response header. | 351 // Action that instructs to remove a response header. |
| 352 class WebRequestRemoveResponseHeaderAction : public WebRequestAction { | 352 class WebRequestRemoveResponseHeaderAction : public WebRequestAction { |
| 353 public: | 353 public: |
| 354 explicit WebRequestRemoveResponseHeaderAction(const std::string& name, | 354 explicit WebRequestRemoveResponseHeaderAction(const std::string& name, |
| 355 const std::string& value, | 355 const std::string& value, |
| 356 bool has_value); | 356 bool has_value); |
| 357 | 357 |
| 358 // Implementation of WebRequestAction: | 358 // Implementation of WebRequestAction: |
| 359 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 359 virtual bool Equals(const WebRequestAction* other) const override; |
| 360 virtual std::string GetName() const OVERRIDE; | 360 virtual std::string GetName() const override; |
| 361 virtual LinkedPtrEventResponseDelta CreateDelta( | 361 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 362 const WebRequestData& request_data, | 362 const WebRequestData& request_data, |
| 363 const std::string& extension_id, | 363 const std::string& extension_id, |
| 364 const base::Time& extension_install_time) const OVERRIDE; | 364 const base::Time& extension_install_time) const override; |
| 365 | 365 |
| 366 private: | 366 private: |
| 367 virtual ~WebRequestRemoveResponseHeaderAction(); | 367 virtual ~WebRequestRemoveResponseHeaderAction(); |
| 368 | 368 |
| 369 std::string name_; | 369 std::string name_; |
| 370 std::string value_; | 370 std::string value_; |
| 371 bool has_value_; | 371 bool has_value_; |
| 372 DISALLOW_COPY_AND_ASSIGN(WebRequestRemoveResponseHeaderAction); | 372 DISALLOW_COPY_AND_ASSIGN(WebRequestRemoveResponseHeaderAction); |
| 373 }; | 373 }; |
| 374 | 374 |
| 375 // Action that instructs to ignore rules below a certain priority. | 375 // Action that instructs to ignore rules below a certain priority. |
| 376 class WebRequestIgnoreRulesAction : public WebRequestAction { | 376 class WebRequestIgnoreRulesAction : public WebRequestAction { |
| 377 public: | 377 public: |
| 378 explicit WebRequestIgnoreRulesAction(int minimum_priority, | 378 explicit WebRequestIgnoreRulesAction(int minimum_priority, |
| 379 const std::string& ignore_tag); | 379 const std::string& ignore_tag); |
| 380 | 380 |
| 381 // Implementation of WebRequestAction: | 381 // Implementation of WebRequestAction: |
| 382 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 382 virtual bool Equals(const WebRequestAction* other) const override; |
| 383 virtual std::string GetName() const OVERRIDE; | 383 virtual std::string GetName() const override; |
| 384 virtual LinkedPtrEventResponseDelta CreateDelta( | 384 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 385 const WebRequestData& request_data, | 385 const WebRequestData& request_data, |
| 386 const std::string& extension_id, | 386 const std::string& extension_id, |
| 387 const base::Time& extension_install_time) const OVERRIDE; | 387 const base::Time& extension_install_time) const override; |
| 388 const std::string& ignore_tag() const { return ignore_tag_; } | 388 const std::string& ignore_tag() const { return ignore_tag_; } |
| 389 | 389 |
| 390 private: | 390 private: |
| 391 virtual ~WebRequestIgnoreRulesAction(); | 391 virtual ~WebRequestIgnoreRulesAction(); |
| 392 | 392 |
| 393 // Rules are ignored if they have a tag matching |ignore_tag_| and | 393 // Rules are ignored if they have a tag matching |ignore_tag_| and |
| 394 // |ignore_tag_| is non-empty. | 394 // |ignore_tag_| is non-empty. |
| 395 std::string ignore_tag_; | 395 std::string ignore_tag_; |
| 396 DISALLOW_COPY_AND_ASSIGN(WebRequestIgnoreRulesAction); | 396 DISALLOW_COPY_AND_ASSIGN(WebRequestIgnoreRulesAction); |
| 397 }; | 397 }; |
| 398 | 398 |
| 399 // Action that instructs to modify (add, edit, remove) a request cookie. | 399 // Action that instructs to modify (add, edit, remove) a request cookie. |
| 400 class WebRequestRequestCookieAction : public WebRequestAction { | 400 class WebRequestRequestCookieAction : public WebRequestAction { |
| 401 public: | 401 public: |
| 402 typedef extension_web_request_api_helpers::RequestCookieModification | 402 typedef extension_web_request_api_helpers::RequestCookieModification |
| 403 RequestCookieModification; | 403 RequestCookieModification; |
| 404 | 404 |
| 405 explicit WebRequestRequestCookieAction( | 405 explicit WebRequestRequestCookieAction( |
| 406 linked_ptr<RequestCookieModification> request_cookie_modification); | 406 linked_ptr<RequestCookieModification> request_cookie_modification); |
| 407 | 407 |
| 408 // Implementation of WebRequestAction: | 408 // Implementation of WebRequestAction: |
| 409 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 409 virtual bool Equals(const WebRequestAction* other) const override; |
| 410 virtual std::string GetName() const OVERRIDE; | 410 virtual std::string GetName() const override; |
| 411 virtual LinkedPtrEventResponseDelta CreateDelta( | 411 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 412 const WebRequestData& request_data, | 412 const WebRequestData& request_data, |
| 413 const std::string& extension_id, | 413 const std::string& extension_id, |
| 414 const base::Time& extension_install_time) const OVERRIDE; | 414 const base::Time& extension_install_time) const override; |
| 415 | 415 |
| 416 private: | 416 private: |
| 417 virtual ~WebRequestRequestCookieAction(); | 417 virtual ~WebRequestRequestCookieAction(); |
| 418 | 418 |
| 419 linked_ptr<RequestCookieModification> request_cookie_modification_; | 419 linked_ptr<RequestCookieModification> request_cookie_modification_; |
| 420 DISALLOW_COPY_AND_ASSIGN(WebRequestRequestCookieAction); | 420 DISALLOW_COPY_AND_ASSIGN(WebRequestRequestCookieAction); |
| 421 }; | 421 }; |
| 422 | 422 |
| 423 // Action that instructs to modify (add, edit, remove) a response cookie. | 423 // Action that instructs to modify (add, edit, remove) a response cookie. |
| 424 class WebRequestResponseCookieAction : public WebRequestAction { | 424 class WebRequestResponseCookieAction : public WebRequestAction { |
| 425 public: | 425 public: |
| 426 typedef extension_web_request_api_helpers::ResponseCookieModification | 426 typedef extension_web_request_api_helpers::ResponseCookieModification |
| 427 ResponseCookieModification; | 427 ResponseCookieModification; |
| 428 | 428 |
| 429 explicit WebRequestResponseCookieAction( | 429 explicit WebRequestResponseCookieAction( |
| 430 linked_ptr<ResponseCookieModification> response_cookie_modification); | 430 linked_ptr<ResponseCookieModification> response_cookie_modification); |
| 431 | 431 |
| 432 // Implementation of WebRequestAction: | 432 // Implementation of WebRequestAction: |
| 433 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 433 virtual bool Equals(const WebRequestAction* other) const override; |
| 434 virtual std::string GetName() const OVERRIDE; | 434 virtual std::string GetName() const override; |
| 435 virtual LinkedPtrEventResponseDelta CreateDelta( | 435 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 436 const WebRequestData& request_data, | 436 const WebRequestData& request_data, |
| 437 const std::string& extension_id, | 437 const std::string& extension_id, |
| 438 const base::Time& extension_install_time) const OVERRIDE; | 438 const base::Time& extension_install_time) const override; |
| 439 | 439 |
| 440 private: | 440 private: |
| 441 virtual ~WebRequestResponseCookieAction(); | 441 virtual ~WebRequestResponseCookieAction(); |
| 442 | 442 |
| 443 linked_ptr<ResponseCookieModification> response_cookie_modification_; | 443 linked_ptr<ResponseCookieModification> response_cookie_modification_; |
| 444 DISALLOW_COPY_AND_ASSIGN(WebRequestResponseCookieAction); | 444 DISALLOW_COPY_AND_ASSIGN(WebRequestResponseCookieAction); |
| 445 }; | 445 }; |
| 446 | 446 |
| 447 // Action that triggers the chrome.declarativeWebRequest.onMessage event in | 447 // Action that triggers the chrome.declarativeWebRequest.onMessage event in |
| 448 // the background/event/... pages of the extension. | 448 // the background/event/... pages of the extension. |
| 449 class WebRequestSendMessageToExtensionAction : public WebRequestAction { | 449 class WebRequestSendMessageToExtensionAction : public WebRequestAction { |
| 450 public: | 450 public: |
| 451 explicit WebRequestSendMessageToExtensionAction(const std::string& message); | 451 explicit WebRequestSendMessageToExtensionAction(const std::string& message); |
| 452 | 452 |
| 453 // Implementation of WebRequestAction: | 453 // Implementation of WebRequestAction: |
| 454 virtual bool Equals(const WebRequestAction* other) const OVERRIDE; | 454 virtual bool Equals(const WebRequestAction* other) const override; |
| 455 virtual std::string GetName() const OVERRIDE; | 455 virtual std::string GetName() const override; |
| 456 virtual LinkedPtrEventResponseDelta CreateDelta( | 456 virtual LinkedPtrEventResponseDelta CreateDelta( |
| 457 const WebRequestData& request_data, | 457 const WebRequestData& request_data, |
| 458 const std::string& extension_id, | 458 const std::string& extension_id, |
| 459 const base::Time& extension_install_time) const OVERRIDE; | 459 const base::Time& extension_install_time) const override; |
| 460 | 460 |
| 461 private: | 461 private: |
| 462 virtual ~WebRequestSendMessageToExtensionAction(); | 462 virtual ~WebRequestSendMessageToExtensionAction(); |
| 463 | 463 |
| 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 // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H_ | 470 #endif // EXTENSIONS_BROWSER_API_DECLARATIVE_WEBREQUEST_WEBREQUEST_ACTION_H_ |
| OLD | NEW |