OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 6 #define CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // be in a different process. | 49 // be in a different process. |
50 class WebPluginImpl : public WebPlugin, | 50 class WebPluginImpl : public WebPlugin, |
51 public blink::WebPlugin { | 51 public blink::WebPlugin { |
52 public: | 52 public: |
53 WebPluginImpl( | 53 WebPluginImpl( |
54 blink::WebFrame* frame, | 54 blink::WebFrame* frame, |
55 const blink::WebPluginParams& params, | 55 const blink::WebPluginParams& params, |
56 const base::FilePath& file_path, | 56 const base::FilePath& file_path, |
57 const base::WeakPtr<RenderViewImpl>& render_view, | 57 const base::WeakPtr<RenderViewImpl>& render_view, |
58 RenderFrameImpl* render_frame); | 58 RenderFrameImpl* render_frame); |
59 virtual ~WebPluginImpl(); | 59 ~WebPluginImpl() override; |
60 | 60 |
61 // Helper function for sorting post data. | 61 // Helper function for sorting post data. |
62 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, | 62 CONTENT_EXPORT static bool SetPostData(blink::WebURLRequest* request, |
63 const char* buf, | 63 const char* buf, |
64 uint32 length); | 64 uint32 length); |
65 | 65 |
66 blink::WebFrame* webframe() { return webframe_; } | 66 blink::WebFrame* webframe() { return webframe_; } |
67 | 67 |
68 // blink::WebPlugin methods: | 68 // blink::WebPlugin methods: |
69 virtual bool initialize( | 69 virtual bool initialize( |
(...skipping 17 matching lines...) Expand all Loading... |
87 virtual void didFinishLoading(); | 87 virtual void didFinishLoading(); |
88 virtual void didFailLoading(const blink::WebURLError& error); | 88 virtual void didFailLoading(const blink::WebURLError& error); |
89 virtual void didFinishLoadingFrameRequest( | 89 virtual void didFinishLoadingFrameRequest( |
90 const blink::WebURL& url, void* notify_data); | 90 const blink::WebURL& url, void* notify_data); |
91 virtual void didFailLoadingFrameRequest( | 91 virtual void didFailLoadingFrameRequest( |
92 const blink::WebURL& url, void* notify_data, | 92 const blink::WebURL& url, void* notify_data, |
93 const blink::WebURLError& error); | 93 const blink::WebURLError& error); |
94 virtual bool isPlaceholder() override; | 94 virtual bool isPlaceholder() override; |
95 | 95 |
96 // WebPlugin implementation: | 96 // WebPlugin implementation: |
97 virtual void SetWindow(gfx::PluginWindowHandle window) override; | 97 void SetWindow(gfx::PluginWindowHandle window) override; |
98 virtual void SetAcceptsInputEvents(bool accepts) override; | 98 void SetAcceptsInputEvents(bool accepts) override; |
99 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) override; | 99 void WillDestroyWindow(gfx::PluginWindowHandle window) override; |
100 virtual void CancelResource(unsigned long id) override; | 100 void CancelResource(unsigned long id) override; |
101 virtual void Invalidate() override; | 101 void Invalidate() override; |
102 virtual void InvalidateRect(const gfx::Rect& rect) override; | 102 void InvalidateRect(const gfx::Rect& rect) override; |
103 virtual NPObject* GetWindowScriptNPObject() override; | 103 NPObject* GetWindowScriptNPObject() override; |
104 virtual NPObject* GetPluginElement() override; | 104 NPObject* GetPluginElement() override; |
105 virtual bool FindProxyForUrl(const GURL& url, | 105 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; |
106 std::string* proxy_list) override; | 106 void SetCookie(const GURL& url, |
107 virtual void SetCookie(const GURL& url, | 107 const GURL& first_party_for_cookies, |
108 const GURL& first_party_for_cookies, | 108 const std::string& cookie) override; |
109 const std::string& cookie) override; | 109 std::string GetCookies(const GURL& url, |
110 virtual std::string GetCookies(const GURL& url, | 110 const GURL& first_party_for_cookies) override; |
111 const GURL& first_party_for_cookies) override; | 111 void HandleURLRequest(const char* url, |
112 virtual void HandleURLRequest(const char* url, | 112 const char* method, |
113 const char *method, | 113 const char* target, |
114 const char* target, | 114 const char* buf, |
115 const char* buf, | 115 unsigned int len, |
116 unsigned int len, | 116 int notify_id, |
117 int notify_id, | 117 bool popups_allowed, |
118 bool popups_allowed, | 118 bool notify_redirects) override; |
119 bool notify_redirects) override; | 119 void CancelDocumentLoad() override; |
120 virtual void CancelDocumentLoad() override; | 120 void InitiateHTTPRangeRequest(const char* url, |
121 virtual void InitiateHTTPRangeRequest(const char* url, | 121 const char* range_info, |
122 const char* range_info, | 122 int pending_request_id) override; |
123 int pending_request_id) override; | 123 void DidStartLoading() override; |
124 virtual void DidStartLoading() override; | 124 void DidStopLoading() override; |
125 virtual void DidStopLoading() override; | 125 bool IsOffTheRecord() override; |
126 virtual bool IsOffTheRecord() override; | 126 void SetDeferResourceLoading(unsigned long resource_id, bool defer) override; |
127 virtual void SetDeferResourceLoading(unsigned long resource_id, | 127 void URLRedirectResponse(bool allow, int resource_id) override; |
128 bool defer) override; | 128 bool CheckIfRunInsecureContent(const GURL& url) override; |
129 virtual void URLRedirectResponse(bool allow, int resource_id) override; | |
130 virtual bool CheckIfRunInsecureContent(const GURL& url) override; | |
131 #if defined(OS_WIN) | 129 #if defined(OS_WIN) |
132 void SetWindowlessData(HANDLE pump_messages_event, | 130 void SetWindowlessData(HANDLE pump_messages_event, |
133 gfx::NativeViewId dummy_activation_window) { } | 131 gfx::NativeViewId dummy_activation_window) { } |
134 void ReparentPluginWindow(HWND window, HWND parent) { } | 132 void ReparentPluginWindow(HWND window, HWND parent) { } |
135 void ReportExecutableMemory(size_t size) { } | 133 void ReportExecutableMemory(size_t size) { } |
136 #endif | 134 #endif |
137 #if defined(OS_MACOSX) | 135 #if defined(OS_MACOSX) |
138 virtual WebPluginAcceleratedSurface* GetAcceleratedSurface( | 136 WebPluginAcceleratedSurface* GetAcceleratedSurface( |
139 gfx::GpuPreference gpu_preference) override; | 137 gfx::GpuPreference gpu_preference) override; |
140 virtual void AcceleratedPluginEnabledRendering() override; | 138 void AcceleratedPluginEnabledRendering() override; |
141 virtual void AcceleratedPluginAllocatedIOSurface(int32 width, | 139 void AcceleratedPluginAllocatedIOSurface(int32 width, |
142 int32 height, | 140 int32 height, |
143 uint32 surface_id) override; | 141 uint32 surface_id) override; |
144 virtual void AcceleratedPluginSwappedIOSurface() override; | 142 void AcceleratedPluginSwappedIOSurface() override; |
145 #endif | 143 #endif |
146 | 144 |
147 private: | 145 private: |
148 // Given a (maybe partial) url, completes using the base url. | 146 // Given a (maybe partial) url, completes using the base url. |
149 GURL CompleteURL(const char* url); | 147 GURL CompleteURL(const char* url); |
150 | 148 |
151 enum RoutingStatus { | 149 enum RoutingStatus { |
152 ROUTED, | 150 ROUTED, |
153 NOT_ROUTED, | 151 NOT_ROUTED, |
154 INVALID_URL, | 152 INVALID_URL, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 LoaderClient loader_client_; | 357 LoaderClient loader_client_; |
360 | 358 |
361 base::WeakPtrFactory<WebPluginImpl> weak_factory_; | 359 base::WeakPtrFactory<WebPluginImpl> weak_factory_; |
362 | 360 |
363 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 361 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
364 }; | 362 }; |
365 | 363 |
366 } // namespace content | 364 } // namespace content |
367 | 365 |
368 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 366 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
OLD | NEW |