blob: 8de21df5521183d749d5eb3edc1222ba4d62e75f [file] [log] [blame]
[email protected]703e807a2009-03-28 19:56:511// 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]73404a372009-04-17 23:09:107#include "base/logging.h"
[email protected]703e807a2009-03-28 19:56:518#include "chrome/browser/extensions/extension_function_dispatcher.h"
9
10void ExtensionFunction::SendResponse(bool success) {
[email protected]73404a372009-04-17 23:09:1011 if (bad_message_) {
12 dispatcher_->HandleBadMessage(this);
13 } else if (success) {
[email protected]e4249822009-04-09 01:49:1114 if (has_callback()) {
15 dispatcher_->SendResponse(this);
16 }
[email protected]703e807a2009-03-28 19:56:5117 } else {
18 // TODO(aa): In case of failure, send the error message to an error
19 // callback.
[email protected]73404a372009-04-17 23:09:1020 LOG(WARNING) << error_;
[email protected]703e807a2009-03-28 19:56:5121 }
22}
[email protected]73404a372009-04-17 23:09:1023
24Profile* ExtensionFunction::profile() {
25 return dispatcher_->profile();
26}
27