1 // Copyright (c) 2013 Intel Corporation. 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.
5 #include "xwalk/extensions/common/xwalk_extension.h"
9 #include "base/logging.h"
12 namespace extensions {
14 bool XWalkExtension::PermissionsDelegate::CheckAPIAccessControl(
15 const std::string& extension_name, const std::string& api_name) {
19 bool XWalkExtension::PermissionsDelegate::RegisterPermissions(
20 const std::string& extension_name, const std::string& perm_table) {
24 XWalkExtension::XWalkExtension() : permissions_delegate_(NULL) {}
26 XWalkExtension::~XWalkExtension() {}
28 const base::ListValue& XWalkExtension::entry_points() const {
32 bool XWalkExtension::CheckAPIAccessControl(const char* api_name) const {
33 if (!permissions_delegate_)
36 return permissions_delegate_->CheckAPIAccessControl(name(), api_name);
39 bool XWalkExtension::RegisterPermissions(const char* perm_table) const {
40 if (!permissions_delegate_)
43 return permissions_delegate_->RegisterPermissions(name(), perm_table);
46 XWalkExtensionInstance::XWalkExtensionInstance() {}
48 XWalkExtensionInstance::~XWalkExtensionInstance() {}
50 void XWalkExtensionInstance::SetPostMessageCallback(
51 const PostMessageCallback& callback) {
52 post_message_ = callback;
55 void XWalkExtensionInstance::SetSendSyncReplyCallback(
56 const SendSyncReplyCallback& callback) {
57 send_sync_reply_ = callback;
60 void XWalkExtensionInstance::HandleSyncMessage(
61 scoped_ptr<base::Value> msg) {
62 LOG(FATAL) << "Sending sync message to extension which doesn't support it!";
65 } // namespace extensions