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_EXTENSION_FUNCTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // Extension functions that run on the UI thread. Most functions fall into | 262 // Extension functions that run on the UI thread. Most functions fall into |
263 // this category. | 263 // this category. |
264 class UIThreadExtensionFunction : public ExtensionFunction { | 264 class UIThreadExtensionFunction : public ExtensionFunction { |
265 public: | 265 public: |
266 // A delegate for use in testing, to intercept the call to SendResponse. | 266 // A delegate for use in testing, to intercept the call to SendResponse. |
267 class DelegateForTests { | 267 class DelegateForTests { |
268 public: | 268 public: |
269 virtual void OnSendResponse(UIThreadExtensionFunction* function, | 269 virtual void OnSendResponse(UIThreadExtensionFunction* function, |
270 bool success, | 270 bool success, |
271 bool bad_message) = 0; | 271 bool bad_message) = 0; |
| 272 |
| 273 protected: |
| 274 virtual ~DelegateForTests() { } |
272 }; | 275 }; |
273 | 276 |
274 UIThreadExtensionFunction(); | 277 UIThreadExtensionFunction(); |
275 | 278 |
276 virtual UIThreadExtensionFunction* AsUIThreadExtensionFunction() OVERRIDE; | 279 virtual UIThreadExtensionFunction* AsUIThreadExtensionFunction() OVERRIDE; |
277 | 280 |
278 void set_test_delegate(DelegateForTests* delegate) { | 281 void set_test_delegate(DelegateForTests* delegate) { |
279 delegate_ = delegate; | 282 delegate_ = delegate; |
280 } | 283 } |
281 | 284 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 public: | 473 public: |
471 SyncIOThreadExtensionFunction(); | 474 SyncIOThreadExtensionFunction(); |
472 | 475 |
473 virtual void Run() OVERRIDE; | 476 virtual void Run() OVERRIDE; |
474 | 477 |
475 protected: | 478 protected: |
476 virtual ~SyncIOThreadExtensionFunction(); | 479 virtual ~SyncIOThreadExtensionFunction(); |
477 }; | 480 }; |
478 | 481 |
479 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 482 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
OLD | NEW |