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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 DISALLOW_COPY_AND_ASSIGN(ExtensionFunction); | 259 DISALLOW_COPY_AND_ASSIGN(ExtensionFunction); |
260 }; | 260 }; |
261 | 261 |
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 ~DelegateForTests() { } |
| 270 |
269 virtual void OnSendResponse(UIThreadExtensionFunction* function, | 271 virtual void OnSendResponse(UIThreadExtensionFunction* function, |
270 bool success, | 272 bool success, |
271 bool bad_message) = 0; | 273 bool bad_message) = 0; |
272 }; | 274 }; |
273 | 275 |
274 UIThreadExtensionFunction(); | 276 UIThreadExtensionFunction(); |
275 | 277 |
276 virtual UIThreadExtensionFunction* AsUIThreadExtensionFunction() OVERRIDE; | 278 virtual UIThreadExtensionFunction* AsUIThreadExtensionFunction() OVERRIDE; |
277 | 279 |
278 void set_test_delegate(DelegateForTests* delegate) { | 280 void set_test_delegate(DelegateForTests* delegate) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 public: | 472 public: |
471 SyncIOThreadExtensionFunction(); | 473 SyncIOThreadExtensionFunction(); |
472 | 474 |
473 virtual void Run() OVERRIDE; | 475 virtual void Run() OVERRIDE; |
474 | 476 |
475 protected: | 477 protected: |
476 virtual ~SyncIOThreadExtensionFunction(); | 478 virtual ~SyncIOThreadExtensionFunction(); |
477 }; | 479 }; |
478 | 480 |
479 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ | 481 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_H_ |
OLD | NEW |