diff options
author | hanxi@chromium.org <hanxi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-22 22:50:01 +0000 |
---|---|---|
committer | hanxi@chromium.org <hanxi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-22 22:51:23 +0000 |
commit | 1fd62287247ebcda39054f331fde44da74e8a0c2 (patch) | |
tree | 0f91c2c7b54ac7274a959d786879838c16664031 /chrome/renderer | |
parent | 70c6a9dc71bf4ec8fa6c4ffb6c9434db6f9b3054 (diff) | |
download | chromium_src-1fd62287247ebcda39054f331fde44da74e8a0c2.zip chromium_src-1fd62287247ebcda39054f331fde44da74e8a0c2.tar.gz chromium_src-1fd62287247ebcda39054f331fde44da74e8a0c2.tar.bz2 |
1. Rename ChromeExtensionHostMsg_AttachGuest as ExtensionHostMsg_AttachGuest.
2. Move its ipc handler to extensions.
BUG=352290
Review URL: https://codereview.chromium.org/497103002
Cr-Commit-Position: refs/heads/master@{#291542}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
3 files changed, 0 insertions, 105 deletions
diff --git a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc index e07f7c0..ccbff5e 100644 --- a/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc +++ b/chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc @@ -20,7 +20,6 @@ #include "chrome/renderer/extensions/enterprise_platform_keys_natives.h" #include "chrome/renderer/extensions/file_browser_handler_custom_bindings.h" #include "chrome/renderer/extensions/file_browser_private_custom_bindings.h" -#include "chrome/renderer/extensions/guest_view_internal_custom_bindings.h" #include "chrome/renderer/extensions/media_galleries_custom_bindings.h" #include "chrome/renderer/extensions/notifications_native_handler.h" #include "chrome/renderer/extensions/page_capture_custom_bindings.h" @@ -119,10 +118,6 @@ void ChromeExtensionsDispatcherDelegate::RegisterNativeHandlers( scoped_ptr<NativeHandler>( new extensions::FileBrowserPrivateCustomBindings(context))); module_system->RegisterNativeHandler( - "guest_view_internal", - scoped_ptr<NativeHandler>( - new extensions::GuestViewInternalCustomBindings(context))); - module_system->RegisterNativeHandler( "notifications_private", scoped_ptr<NativeHandler>( new extensions::NotificationsNativeHandler(context))); diff --git a/chrome/renderer/extensions/guest_view_internal_custom_bindings.cc b/chrome/renderer/extensions/guest_view_internal_custom_bindings.cc deleted file mode 100644 index 4cc0d4d..0000000 --- a/chrome/renderer/extensions/guest_view_internal_custom_bindings.cc +++ /dev/null @@ -1,65 +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 "chrome/renderer/extensions/guest_view_internal_custom_bindings.h" - -#include <string> - -#include "base/bind.h" -#include "chrome/common/extensions/chrome_extension_messages.h" -#include "content/public/renderer/render_frame.h" -#include "content/public/renderer/render_view.h" -#include "content/public/renderer/v8_value_converter.h" -#include "extensions/common/extension.h" -#include "extensions/renderer/script_context.h" -#include "v8/include/v8.h" - -using content::V8ValueConverter; - -namespace extensions { - -GuestViewInternalCustomBindings::GuestViewInternalCustomBindings( - ScriptContext* context) - : ObjectBackedNativeHandler(context) { - RouteFunction("AttachGuest", - base::Bind(&GuestViewInternalCustomBindings::AttachGuest, - base::Unretained(this))); -} - -void GuestViewInternalCustomBindings::AttachGuest( - const v8::FunctionCallbackInfo<v8::Value>& args) { - CHECK(args.Length() == 3 && args[0]->IsInt32() && args[1]->IsInt32() && - args[2]->IsObject()); - - content::RenderFrame* render_frame = context()->GetRenderFrame(); - if (!render_frame) - return; - - int element_instance_id = args[0]->Int32Value(); - int guest_instance_id = args[1]->Int32Value(); - - scoped_ptr<base::DictionaryValue> params; - { - scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); - scoped_ptr<base::Value> params_as_value( - converter->FromV8Value(args[2], context()->v8_context())); - CHECK(params_as_value->IsType(base::Value::TYPE_DICTIONARY)); - params.reset( - static_cast<base::DictionaryValue*>(params_as_value.release())); - } - - // Step 1, send the attach params to chrome/. - render_frame->Send(new ChromeExtensionHostMsg_AttachGuest( - render_frame->GetRenderView()->GetRoutingID(), - element_instance_id, - guest_instance_id, - *params)); - - // Step 2, attach plugin through content/. - render_frame->AttachGuest(element_instance_id); - - args.GetReturnValue().Set(v8::Boolean::New(context()->isolate(), true)); -} - -} // namespace extensions diff --git a/chrome/renderer/extensions/guest_view_internal_custom_bindings.h b/chrome/renderer/extensions/guest_view_internal_custom_bindings.h deleted file mode 100644 index b034af1..0000000 --- a/chrome/renderer/extensions/guest_view_internal_custom_bindings.h +++ /dev/null @@ -1,35 +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. - -#ifndef CHROME_RENDERER_EXTENSIONS_GUEST_VIEW_INTERNAL_CUSTOM_BINDINGS_H_ -#define CHROME_RENDERER_EXTENSIONS_GUEST_VIEW_INTERNAL_CUSTOM_BINDINGS_H_ - -#include "extensions/renderer/object_backed_native_handler.h" - -namespace extensions { -class Dispatcher; - -// Implements custom bindings for the guestViewInternal API. -class GuestViewInternalCustomBindings : public ObjectBackedNativeHandler { - public: - explicit GuestViewInternalCustomBindings(ScriptContext* context); - - private: - // AttachGuest attaches a GuestView to a provided container element. Once - // attached, the GuestView will participate in layout of the container page - // and become visible on screen. - // AttachGuest takes three parameters: - // |element_instance_id| uniquely identifies a container within the content - // module is able to host GuestViews. - // |guest_instance_id| uniquely identifies an unattached GuestView. - // |attach_params| is typically used to convey the current state of the - // container element at the time of attachment. These parameters are passed - // down to the GuestView. The GuestView may use these parameters to update the - // state of the guest hosted in another process. - void AttachGuest(const v8::FunctionCallbackInfo<v8::Value>& args); -}; - -} // namespace extensions - -#endif // CHROME_RENDERER_EXTENSIONS_GUEST_VIEW_INTERNAL_CUSTOM_BINDINGS_H_ |