Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1988)

Unified Diff: apps/shell/renderer/shell_custom_bindings.cc

Issue 412713002: Move apps/shell to extensions/shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 40% Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/shell/renderer/shell_custom_bindings.h ('k') | apps/shell/renderer/shell_custom_bindings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/shell/renderer/shell_custom_bindings.cc
diff --git a/apps/shell/renderer/shell_custom_bindings.cc b/apps/shell/renderer/shell_custom_bindings.cc
deleted file mode 100644
index c4101b6ba0886dbe852fda02367bd54a8b703e95..0000000000000000000000000000000000000000
--- a/apps/shell/renderer/shell_custom_bindings.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2014 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 "apps/shell/renderer/shell_custom_bindings.h"
-
-#include "content/public/renderer/render_thread.h"
-#include "content/public/renderer/render_view.h"
-#include "content/public/renderer/v8_value_converter.h"
-#include "extensions/common/extension_messages.h"
-#include "extensions/renderer/script_context.h"
-#include "extensions/renderer/script_context_set.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
-#include "third_party/WebKit/public/web/WebView.h"
-#include "v8/include/v8.h"
-
-namespace apps {
-
-ShellCustomBindings::ShellCustomBindings(extensions::ScriptContext* context)
- : extensions::ObjectBackedNativeHandler(context) {
- RouteFunction(
- "GetView",
- base::Bind(&ShellCustomBindings::GetView, base::Unretained(this)));
-}
-
-void ShellCustomBindings::GetView(
- const v8::FunctionCallbackInfo<v8::Value>& args) {
- if (args.Length() != 1 || !args[0]->IsInt32())
- return;
-
- int view_id = args[0]->Int32Value();
- if (view_id == MSG_ROUTING_NONE)
- return;
-
- content::RenderView* view = content::RenderView::FromRoutingID(view_id);
- if (!view)
- return;
-
- // Set the opener so we have a security origin set up before returning the DOM
- // reference.
- content::RenderView* render_view = context()->GetRenderView();
- if (!render_view)
- return;
- blink::WebFrame* opener = render_view->GetWebView()->mainFrame();
- blink::WebFrame* frame = view->GetWebView()->mainFrame();
- frame->setOpener(opener);
-
- // Resume resource requests.
- content::RenderThread::Get()->Send(
- new ExtensionHostMsg_ResumeRequests(view->GetRoutingID()));
-
- // Return the script context.
- v8::Local<v8::Value> window = frame->mainWorldScriptContext()->Global();
- args.GetReturnValue().Set(window);
-}
-
-} // namespace apps
« no previous file with comments | « apps/shell/renderer/shell_custom_bindings.h ('k') | apps/shell/renderer/shell_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698