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

Side by Side Diff: extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h

Issue 1162053003: Move BrowserPluginDelegate's lifetime mgmt out of content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync @tott Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA INER_H_ 5 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA INER_H_
6 #define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA INER_H_ 6 #define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA INER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 23 matching lines...) Expand all
34 // renderer. We make a URL request for the data inside the container using 34 // renderer. We make a URL request for the data inside the container using
35 // a WebURLLoader. In this case, the |didReceiveData| and |didFinishLoading| 35 // a WebURLLoader. In this case, the |didReceiveData| and |didFinishLoading|
36 // (from WebURLLoaderClient) when data is received and when it has finished 36 // (from WebURLLoaderClient) when data is received and when it has finished
37 // being received. 37 // being received.
38 class MimeHandlerViewContainer : public guest_view::GuestViewContainer, 38 class MimeHandlerViewContainer : public guest_view::GuestViewContainer,
39 public blink::WebURLLoaderClient { 39 public blink::WebURLLoaderClient {
40 public: 40 public:
41 MimeHandlerViewContainer(content::RenderFrame* render_frame, 41 MimeHandlerViewContainer(content::RenderFrame* render_frame,
42 const std::string& mime_type, 42 const std::string& mime_type,
43 const GURL& original_url); 43 const GURL& original_url);
44 ~MimeHandlerViewContainer() override;
45 44
46 static std::vector<MimeHandlerViewContainer*> FromRenderFrame( 45 static std::vector<MimeHandlerViewContainer*> FromRenderFrame(
47 content::RenderFrame* render_frame); 46 content::RenderFrame* render_frame);
48 47
49 // GuestViewContainer implementation. 48 // GuestViewContainer implementation.
50 bool OnMessage(const IPC::Message& message) override; 49 bool OnMessage(const IPC::Message& message) override;
51 void OnReady() override; 50 void OnReady() override;
52 51
53 // BrowserPluginDelegate implementation. 52 // BrowserPluginDelegate implementation.
54 void DidFinishLoading() override; 53 void DidFinishLoading() override;
(...skipping 12 matching lines...) Expand all
67 66
68 // GuestViewContainer overrides. 67 // GuestViewContainer overrides.
69 void OnRenderFrameDestroyed() override; 68 void OnRenderFrameDestroyed() override;
70 69
71 // Post a JavaScript message to the guest. 70 // Post a JavaScript message to the guest.
72 void PostMessage(v8::Isolate* isolate, v8::Local<v8::Value> message); 71 void PostMessage(v8::Isolate* isolate, v8::Local<v8::Value> message);
73 72
74 // Post |message| to the guest. 73 // Post |message| to the guest.
75 void PostMessageFromValue(const base::Value& message); 74 void PostMessageFromValue(const base::Value& message);
76 75
76 protected:
77 ~MimeHandlerViewContainer() override;
78
77 private: 79 private:
78 // Message handlers. 80 // Message handlers.
79 void OnCreateMimeHandlerViewGuestACK(int element_instance_id); 81 void OnCreateMimeHandlerViewGuestACK(int element_instance_id);
80 void OnGuestAttached(int element_instance_id, 82 void OnGuestAttached(int element_instance_id,
81 int guest_proxy_routing_id); 83 int guest_proxy_routing_id);
82 void OnMimeHandlerViewGuestOnLoadCompleted(int element_instance_id); 84 void OnMimeHandlerViewGuestOnLoadCompleted(int element_instance_id);
83 85
84 void CreateMimeHandlerViewGuest(); 86 void CreateMimeHandlerViewGuest();
85 87
86 // The MIME type of the plugin. 88 // The MIME type of the plugin.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 gfx::Size element_size_; 120 gfx::Size element_size_;
119 121
120 base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_; 122 base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_;
121 123
122 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer); 124 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer);
123 }; 125 };
124 126
125 } // namespace extensions 127 } // namespace extensions
126 128
127 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CO NTAINER_H_ 129 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CO NTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698