| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSION_FUNCTION_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 void set_histogram_value( | 289 void set_histogram_value( |
| 290 extensions::functions::HistogramValue histogram_value) { | 290 extensions::functions::HistogramValue histogram_value) { |
| 291 histogram_value_ = histogram_value; } | 291 histogram_value_ = histogram_value; } |
| 292 extensions::functions::HistogramValue histogram_value() const { | 292 extensions::functions::HistogramValue histogram_value() const { |
| 293 return histogram_value_; } | 293 return histogram_value_; } |
| 294 | 294 |
| 295 void set_response_callback(const ResponseCallback& callback) { | 295 void set_response_callback(const ResponseCallback& callback) { |
| 296 response_callback_ = callback; | 296 response_callback_ = callback; |
| 297 } | 297 } |
| 298 | 298 |
| 299 void set_source_tab_id(int source_tab_id) { source_tab_id_ = source_tab_id; } | |
| 300 int source_tab_id() const { return source_tab_id_; } | |
| 301 | |
| 302 void set_source_context_type(extensions::Feature::Context type) { | 299 void set_source_context_type(extensions::Feature::Context type) { |
| 303 source_context_type_ = type; | 300 source_context_type_ = type; |
| 304 } | 301 } |
| 305 extensions::Feature::Context source_context_type() const { | 302 extensions::Feature::Context source_context_type() const { |
| 306 return source_context_type_; | 303 return source_context_type_; |
| 307 } | 304 } |
| 308 | 305 |
| 309 void set_source_process_id(int source_process_id) { | 306 void set_source_process_id(int source_process_id) { |
| 310 source_process_id_ = source_process_id; | 307 source_process_id_ = source_process_id; |
| 311 } | 308 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 bool user_gesture_; | 455 bool user_gesture_; |
| 459 | 456 |
| 460 // Any class that gets a malformed message should set this to true before | 457 // Any class that gets a malformed message should set this to true before |
| 461 // returning. Usually we want to kill the message sending process. | 458 // returning. Usually we want to kill the message sending process. |
| 462 bool bad_message_; | 459 bool bad_message_; |
| 463 | 460 |
| 464 // The sample value to record with the histogram API when the function | 461 // The sample value to record with the histogram API when the function |
| 465 // is invoked. | 462 // is invoked. |
| 466 extensions::functions::HistogramValue histogram_value_; | 463 extensions::functions::HistogramValue histogram_value_; |
| 467 | 464 |
| 468 // The ID of the tab triggered this function call, or -1 if there is no tab. | |
| 469 int source_tab_id_; | |
| 470 | |
| 471 // The type of the JavaScript context where this call originated. | 465 // The type of the JavaScript context where this call originated. |
| 472 extensions::Feature::Context source_context_type_; | 466 extensions::Feature::Context source_context_type_; |
| 473 | 467 |
| 474 // The process ID of the page that triggered this function call, or -1 | 468 // The process ID of the page that triggered this function call, or -1 |
| 475 // if unknown. | 469 // if unknown. |
| 476 int source_process_id_; | 470 int source_process_id_; |
| 477 | 471 |
| 478 // The response type of the function, if the response has been sent. | 472 // The response type of the function, if the response has been sent. |
| 479 std::unique_ptr<ResponseType> response_type_; | 473 std::unique_ptr<ResponseType> response_type_; |
| 480 | 474 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 private: | 671 private: |
| 678 // If you're hitting a compile error here due to "final" - great! You're | 672 // If you're hitting a compile error here due to "final" - great! You're |
| 679 // doing the right thing, you just need to extend UIThreadExtensionFunction | 673 // doing the right thing, you just need to extend UIThreadExtensionFunction |
| 680 // instead of AsyncExtensionFunction. | 674 // instead of AsyncExtensionFunction. |
| 681 ResponseAction Run() final; | 675 ResponseAction Run() final; |
| 682 | 676 |
| 683 DISALLOW_COPY_AND_ASSIGN(AsyncExtensionFunction); | 677 DISALLOW_COPY_AND_ASSIGN(AsyncExtensionFunction); |
| 684 }; | 678 }; |
| 685 | 679 |
| 686 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ | 680 #endif // EXTENSIONS_BROWSER_EXTENSION_FUNCTION_H_ |
| OLD | NEW |