'common/options_switches.h',
'common/v8_value_converter_impl.cc',
'common/v8_value_converter_impl.h',
+ 'renderer/api/atom_renderer_bindings.cc',
+ 'renderer/api/atom_renderer_bindings.h',
'renderer/atom_render_view_observer.cc',
'renderer/atom_render_view_observer.h',
'renderer/atom_renderer_client.cc',
#include "common/api/atom_bindings.h"
#include "base/logging.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "vendor/node/src/node.h"
namespace atom {
v8::String::New("No such module")));
}
-void AtomBindings::BindToFrame(WebKit::WebFrame* frame) {
- v8::HandleScope handle_scope;
-
- v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
- if (context.IsEmpty())
- return;
-
- v8::Context::Scope scope(context);
-
- v8::Handle<v8::Object> process =
- context->Global()->Get(v8::String::New("process"))->ToObject();
- DCHECK(!process.IsEmpty());
-
- AtomBindings::BindTo(process);
-}
-
} // namespace atom
// load native code from atom-shell instead.
virtual void BindTo(v8::Handle<v8::Object> process);
- // Call BindTo for process object of the frame.
- void BindToFrame(WebKit::WebFrame* frame);
-
private:
static v8::Handle<v8::Value> Binding(const v8::Arguments& args);
--- /dev/null
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "renderer/api/atom_renderer_bindings.h"
+
+#include "base/logging.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
+
+namespace atom {
+
+AtomRendererBindings::AtomRendererBindings() {
+}
+
+AtomRendererBindings::~AtomRendererBindings() {
+}
+
+void AtomRendererBindings::BindToFrame(WebKit::WebFrame* frame) {
+ v8::HandleScope handle_scope;
+
+ v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
+ if (context.IsEmpty())
+ return;
+
+ v8::Context::Scope scope(context);
+
+ v8::Handle<v8::Object> process =
+ context->Global()->Get(v8::String::New("process"))->ToObject();
+ DCHECK(!process.IsEmpty());
+
+ AtomBindings::BindTo(process);
+}
+
+} // namespace atom
--- /dev/null
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_RENDERER_API_ATOM_RENDERER_BINDINGS_
+#define ATOM_RENDERER_API_ATOM_RENDERER_BINDINGS_
+
+#include "common/api/atom_bindings.h"
+
+namespace atom {
+
+class AtomRendererBindings : public AtomBindings {
+ public:
+ AtomRendererBindings();
+ virtual ~AtomRendererBindings();
+
+ // Call BindTo for process object of the frame.
+ void BindToFrame(WebKit::WebFrame* frame);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AtomRendererBindings);
+};
+
+} // namespace atom
+
+#endif // ATOM_RENDERER_API_ATOM_BINDINGS_
#include <algorithm>
#include <vector>
-#include "common/api/atom_bindings.h"
#include "common/node_bindings.h"
+#include "renderer/api/atom_renderer_bindings.h"
#include "renderer/atom_renderer_client.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "v8/include/v8.h"
#include "renderer/atom_renderer_client.h"
-#include "common/api/atom_bindings.h"
#include "common/node_bindings.h"
+#include "renderer/api/atom_renderer_bindings.h"
#include "renderer/atom_render_view_observer.h"
#include "vendor/node/src/node_internals.h"
namespace atom {
AtomRendererClient::AtomRendererClient()
- : atom_bindings_(new AtomBindings),
+ : atom_bindings_(new AtomRendererBindings),
node_bindings_(NodeBindings::Create(false)) {
}
namespace atom {
-class AtomBindings;
+class AtomRendererBindings;
class NodeBindings;
class AtomRendererClient : public content::ContentRendererClient {
AtomRendererClient();
virtual ~AtomRendererClient();
- AtomBindings* atom_bindings() const { return atom_bindings_.get(); }
+ AtomRendererBindings* atom_bindings() const { return atom_bindings_.get(); }
NodeBindings* node_bindings() const { return node_bindings_.get(); }
private:
virtual void RenderThreadStarted() OVERRIDE;
virtual void RenderViewCreated(content::RenderView*) OVERRIDE;
- scoped_ptr<AtomBindings> atom_bindings_;
+ scoped_ptr<AtomRendererBindings> atom_bindings_;
scoped_ptr<NodeBindings> node_bindings_;
DISALLOW_COPY_AND_ASSIGN(AtomRendererClient);