[email protected] | 703e807a | 2009-03-28 19:56:51 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "chrome/browser/extensions/extension_function.h" | ||||
6 | |||||
[email protected] | 73404a37 | 2009-04-17 23:09:10 | [diff] [blame^] | 7 | #include "base/logging.h" |
[email protected] | 703e807a | 2009-03-28 19:56:51 | [diff] [blame] | 8 | #include "chrome/browser/extensions/extension_function_dispatcher.h" |
9 | |||||
10 | void ExtensionFunction::SendResponse(bool success) { | ||||
[email protected] | 73404a37 | 2009-04-17 23:09:10 | [diff] [blame^] | 11 | if (bad_message_) { |
12 | dispatcher_->HandleBadMessage(this); | ||||
13 | } else if (success) { | ||||
[email protected] | e424982 | 2009-04-09 01:49:11 | [diff] [blame] | 14 | if (has_callback()) { |
15 | dispatcher_->SendResponse(this); | ||||
16 | } | ||||
[email protected] | 703e807a | 2009-03-28 19:56:51 | [diff] [blame] | 17 | } else { |
18 | // TODO(aa): In case of failure, send the error message to an error | ||||
19 | // callback. | ||||
[email protected] | 73404a37 | 2009-04-17 23:09:10 | [diff] [blame^] | 20 | LOG(WARNING) << error_; |
[email protected] | 703e807a | 2009-03-28 19:56:51 | [diff] [blame] | 21 | } |
22 | } | ||||
[email protected] | 73404a37 | 2009-04-17 23:09:10 | [diff] [blame^] | 23 | |
24 | Profile* ExtensionFunction::profile() { | ||||
25 | return dispatcher_->profile(); | ||||
26 | } | ||||
27 |