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 #include "chrome/browser/extensions/chrome_extension_function.h" | 5 #include "chrome/browser/extensions/chrome_extension_function.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "chrome/browser/extensions/chrome_extension_function_details.h" | 9 #include "chrome/browser/extensions/chrome_extension_function_details.h" |
10 #include "chrome/browser/extensions/window_controller.h" | 10 #include "chrome/browser/extensions/window_controller.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 extensions::WindowController* | 35 extensions::WindowController* |
36 ChromeUIThreadExtensionFunction::GetExtensionWindowController() { | 36 ChromeUIThreadExtensionFunction::GetExtensionWindowController() { |
37 return chrome_details_.GetExtensionWindowController(); | 37 return chrome_details_.GetExtensionWindowController(); |
38 } | 38 } |
39 | 39 |
40 content::WebContents* | 40 content::WebContents* |
41 ChromeUIThreadExtensionFunction::GetAssociatedWebContents() { | 41 ChromeUIThreadExtensionFunction::GetAssociatedWebContents() { |
42 return chrome_details_.GetAssociatedWebContents(); | 42 return chrome_details_.GetAssociatedWebContents(); |
43 } | 43 } |
44 | 44 |
| 45 void ChromeUIThreadExtensionFunction::SendResponse(bool success) { |
| 46 Respond(success ? ArgumentList(std::move(results_)) : Error(error_)); |
| 47 } |
| 48 |
45 ChromeUIThreadExtensionFunction::~ChromeUIThreadExtensionFunction() { | 49 ChromeUIThreadExtensionFunction::~ChromeUIThreadExtensionFunction() { |
46 } | 50 } |
47 | 51 |
48 ChromeAsyncExtensionFunction::ChromeAsyncExtensionFunction() { | 52 ChromeAsyncExtensionFunction::ChromeAsyncExtensionFunction() { |
49 } | 53 } |
50 | 54 |
51 ChromeAsyncExtensionFunction::~ChromeAsyncExtensionFunction() {} | 55 ChromeAsyncExtensionFunction::~ChromeAsyncExtensionFunction() {} |
52 | 56 |
53 ExtensionFunction::ResponseAction ChromeAsyncExtensionFunction::Run() { | 57 ExtensionFunction::ResponseAction ChromeAsyncExtensionFunction::Run() { |
54 return RunAsync() ? RespondLater() : RespondNow(Error(error_)); | 58 return RunAsync() ? RespondLater() : RespondNow(Error(error_)); |
(...skipping 13 matching lines...) Expand all Loading... |
68 ExtensionFunction::ResponseAction ChromeSyncExtensionFunction::Run() { | 72 ExtensionFunction::ResponseAction ChromeSyncExtensionFunction::Run() { |
69 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) | 73 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) |
70 : Error(error_)); | 74 : Error(error_)); |
71 } | 75 } |
72 | 76 |
73 // static | 77 // static |
74 bool ChromeSyncExtensionFunction::ValidationFailure( | 78 bool ChromeSyncExtensionFunction::ValidationFailure( |
75 ChromeSyncExtensionFunction* function) { | 79 ChromeSyncExtensionFunction* function) { |
76 return false; | 80 return false; |
77 } | 81 } |
OLD | NEW |