Chromium Code Reviews| Index: extensions/renderer/guest_view/web_view_container.h |
| diff --git a/extensions/renderer/guest_view/guest_view_container.h b/extensions/renderer/guest_view/web_view_container.h |
| similarity index 59% |
| copy from extensions/renderer/guest_view/guest_view_container.h |
| copy to extensions/renderer/guest_view/web_view_container.h |
| index d891775c94c90f162512625eac67485d46e56f16..1a46166ff84d9ff31061131add8590f84f7946f7 100644 |
| --- a/extensions/renderer/guest_view/guest_view_container.h |
| +++ b/extensions/renderer/guest_view/web_view_container.h |
| @@ -2,22 +2,20 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
| -#define CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
| +#ifndef CHROME_RENDERER_GUEST_VIEW_WEB_VIEW_CONTAINER_H_ |
|
Fady Samuel
2014/11/03 11:03:38
This should be updated to say extensions.
raymes
2014/11/03 22:51:32
Done.
|
| +#define CHROME_RENDERER_GUEST_VIEW_WEB_VIEW_CONTAINER_H_ |
| #include <queue> |
| #include "base/memory/linked_ptr.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/values.h" |
| -#include "content/public/renderer/browser_plugin_delegate.h" |
| -#include "content/public/renderer/render_frame_observer.h" |
| +#include "extensions/renderer/guest_view/guest_view_container.h" |
| #include "extensions/renderer/scoped_persistent.h" |
| namespace extensions { |
| -class GuestViewContainer : public content::BrowserPluginDelegate, |
| - public content::RenderFrameObserver { |
| +class WebViewContainer : public GuestViewContainer { |
|
Fady Samuel
2014/11/03 11:03:38
Multiple guest types need this container type. I w
raymes
2014/11/03 22:51:32
Done.
|
| public: |
| // This class represents an AttachGuest request from Javascript. It includes |
| // the input parameters and the callback function. The Attach operation may |
| @@ -54,52 +52,38 @@ class GuestViewContainer : public content::BrowserPluginDelegate, |
| v8::Isolate* const isolate_; |
| }; |
| - GuestViewContainer(content::RenderFrame* render_frame, |
| - const std::string& mime_type); |
| - ~GuestViewContainer() override; |
| + explicit WebViewContainer(content::RenderFrame* render_frame); |
| + ~WebViewContainer() override; |
| - static GuestViewContainer* FromID(int render_view_routing_id, |
| - int element_instance_id); |
| + static WebViewContainer* FromID(int render_view_routing_id, |
| + int element_instance_id); |
| void AttachGuest(linked_ptr<AttachRequest> request); |
| // BrowserPluginDelegate implementation. |
| void SetElementInstanceID(int element_instance_id) override; |
| - void DidFinishLoading() override; |
| - void DidReceiveData(const char* data, int data_length) override; |
| void Ready() override; |
| - // RenderFrameObserver override. |
| - void OnDestruct() override; |
| - bool OnMessageReceived(const IPC::Message& message) override; |
| + // GuestViewContainer override. |
| + bool HandlesMessage(const IPC::Message& message) override; |
| + bool OnMessage(const IPC::Message& message) override; |
| private: |
| - void OnCreateMimeHandlerViewGuestACK(int element_instance_id); |
| - void OnGuestAttached(int element_instance_id, int guest_proxy_routing_id); |
| + void OnGuestAttached(int guest_proxy_routing_id); |
| void AttachGuestInternal(linked_ptr<AttachRequest> request); |
| void EnqueueAttachRequest(linked_ptr<AttachRequest> request); |
| void PerformPendingAttachRequest(); |
| void HandlePendingResponseCallback(int guest_proxy_routing_id); |
| - static bool ShouldHandleMessage(const IPC::Message& mesage); |
| - |
| - const std::string mime_type_; |
| - int element_instance_id_; |
| - std::string html_string_; |
| - // Save the RenderView RoutingID here so that we can use it during |
| - // destruction. |
| - int render_view_routing_id_; |
| - |
| - bool attached_; |
| bool ready_; |
| std::deque<linked_ptr<AttachRequest> > pending_requests_; |
| linked_ptr<AttachRequest> pending_response_; |
| - DISALLOW_COPY_AND_ASSIGN(GuestViewContainer); |
| + DISALLOW_COPY_AND_ASSIGN(WebViewContainer); |
| }; |
| } // namespace extensions |
| -#endif // CHROME_RENDERER_GUEST_VIEW_GUEST_VIEW_CONTAINER_H_ |
| +#endif // CHROME_RENDERER_GUEST_VIEW_WEB_VIEW_CONTAINER_H_ |