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