diff options
author | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-27 19:35:09 +0000 |
---|---|---|
committer | mpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-27 19:35:09 +0000 |
commit | 81e6378c98d0e69339302527eb1de4735d1e2c3f (patch) | |
tree | d8020f1a2a842b0735c22a35e89a97ec7630bf17 /chrome/renderer/extensions | |
parent | 4c8c60ee58cf2f22fcdc0cf3b30f1f5e8884f0ff (diff) | |
download | chromium_src-81e6378c98d0e69339302527eb1de4735d1e2c3f.zip chromium_src-81e6378c98d0e69339302527eb1de4735d1e2c3f.tar.gz chromium_src-81e6378c98d0e69339302527eb1de4735d1e2c3f.tar.bz2 |
Prototype extension process. This is a proof of concept, with a lot of
rough edges. Mostly this just fires up a renderer with an "extension" object
exposed, which right now only has a single method "getTestString".
I also did some misc cleanup along the way.
Review URL: http://codereview.chromium.org/27187
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rwxr-xr-x | chrome/renderer/extensions/extension_bindings.cc | 19 | ||||
-rwxr-xr-x | chrome/renderer/extensions/extension_bindings.h | 25 |
2 files changed, 44 insertions, 0 deletions
diff --git a/chrome/renderer/extensions/extension_bindings.cc b/chrome/renderer/extensions/extension_bindings.cc new file mode 100755 index 0000000..24c66d3 --- /dev/null +++ b/chrome/renderer/extensions/extension_bindings.cc @@ -0,0 +1,19 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/renderer/extensions/extension_bindings.h" + +#include "base/values.h" +#include "chrome/common/render_messages.h" + +#define BIND_METHOD(name) BindMethod(#name, &ExtensionBindings::name) +ExtensionBindings::ExtensionBindings() { + BIND_METHOD(getTestString); +} +#undef BIND_METHOD + +void ExtensionBindings::getTestString( + const CppArgumentList& args, CppVariant* result) { + result->Set("This is a placeholder string. It's here to hold places."); +} diff --git a/chrome/renderer/extensions/extension_bindings.h b/chrome/renderer/extensions/extension_bindings.h new file mode 100755 index 0000000..a4b86cc --- /dev/null +++ b/chrome/renderer/extensions/extension_bindings.h @@ -0,0 +1,25 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_BINDINGS_H__ +#define CHROME_RENDERER_EXTENSIONS_EXTENSION_BINDINGS_H__ + +#include "chrome/common/ipc_message.h" +#include "chrome/renderer/dom_ui_bindings.h" + +// ExtensionBindings is the class backing the "extension" object +// accessible from JavaScript. +class ExtensionBindings : public DOMBoundBrowserObject { + public: + ExtensionBindings(); + virtual ~ExtensionBindings() {} + + // Methods exposed to JavaScript. + void getTestString(const CppArgumentList& args, CppVariant* result); + + private: + DISALLOW_COPY_AND_ASSIGN(ExtensionBindings); +}; + +#endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_BINDINGS_H__ |