| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 bool is_visible) override; | 82 bool is_visible) override; |
| 83 void updateFocus(bool focused, blink::WebFocusType focus_type) override; | 83 void updateFocus(bool focused, blink::WebFocusType focus_type) override; |
| 84 void updateVisibility(bool visible) override; | 84 void updateVisibility(bool visible) override; |
| 85 bool acceptsInputEvents() override; | 85 bool acceptsInputEvents() override; |
| 86 bool handleInputEvent(const blink::WebInputEvent& event, | 86 bool handleInputEvent(const blink::WebInputEvent& event, |
| 87 blink::WebCursorInfo& cursor_info) override; | 87 blink::WebCursorInfo& cursor_info) override; |
| 88 void didReceiveResponse(const blink::WebURLResponse& response) override; | 88 void didReceiveResponse(const blink::WebURLResponse& response) override; |
| 89 void didReceiveData(const char* data, int data_length) override; | 89 void didReceiveData(const char* data, int data_length) override; |
| 90 void didFinishLoading() override; | 90 void didFinishLoading() override; |
| 91 void didFailLoading(const blink::WebURLError& error) override; | 91 void didFailLoading(const blink::WebURLError& error) override; |
| 92 void didFinishLoadingFrameRequest(const blink::WebURL& url, | |
| 93 void* notify_data) override; | |
| 94 void didFailLoadingFrameRequest(const blink::WebURL& url, | |
| 95 void* notify_data, | |
| 96 const blink::WebURLError& error) override; | |
| 97 bool isPlaceholder() override; | 92 bool isPlaceholder() override; |
| 98 | 93 |
| 99 // WebPlugin implementation: | 94 // WebPlugin implementation: |
| 100 void SetWindow(gfx::PluginWindowHandle window) override; | 95 void SetWindow(gfx::PluginWindowHandle window) override; |
| 101 void SetAcceptsInputEvents(bool accepts) override; | 96 void SetAcceptsInputEvents(bool accepts) override; |
| 102 void WillDestroyWindow(gfx::PluginWindowHandle window) override; | 97 void WillDestroyWindow(gfx::PluginWindowHandle window) override; |
| 103 void CancelResource(unsigned long id) override; | 98 void CancelResource(unsigned long id) override; |
| 104 void Invalidate() override; | 99 void Invalidate() override; |
| 105 void InvalidateRect(const gfx::Rect& rect) override; | 100 void InvalidateRect(const gfx::Rect& rect) override; |
| 106 NPObject* GetWindowScriptNPObject() override; | 101 NPObject* GetWindowScriptNPObject() override; |
| 107 NPObject* GetPluginElement() override; | 102 NPObject* GetPluginElement() override; |
| 108 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; | 103 bool FindProxyForUrl(const GURL& url, std::string* proxy_list) override; |
| 109 void SetCookie(const GURL& url, | 104 void SetCookie(const GURL& url, |
| 110 const GURL& first_party_for_cookies, | 105 const GURL& first_party_for_cookies, |
| 111 const std::string& cookie) override; | 106 const std::string& cookie) override; |
| 112 std::string GetCookies(const GURL& url, | 107 std::string GetCookies(const GURL& url, |
| 113 const GURL& first_party_for_cookies) override; | 108 const GURL& first_party_for_cookies) override; |
| 114 void HandleURLRequest(const char* url, | 109 void HandleURLRequest(const char* url, |
| 115 const char* method, | 110 const char* method, |
| 116 const char* target, | 111 const char* target, |
| 117 const char* buf, | 112 const char* buf, |
| 118 unsigned int len, | 113 unsigned int len, |
| 119 int notify_id, | |
| 120 bool popups_allowed, | 114 bool popups_allowed, |
| 121 bool notify_redirects) override; | 115 bool notify_redirects) override; |
| 122 void CancelDocumentLoad() override; | 116 void CancelDocumentLoad() override; |
| 123 void InitiateHTTPRangeRequest(const char* url, | 117 void InitiateHTTPRangeRequest(const char* url, |
| 124 const char* range_info, | 118 const char* range_info, |
| 125 int pending_request_id) override; | 119 int pending_request_id) override; |
| 126 void DidStartLoading() override; | 120 void DidStartLoading() override; |
| 127 void DidStopLoading() override; | 121 void DidStopLoading() override; |
| 128 bool IsOffTheRecord() override; | 122 bool IsOffTheRecord() override; |
| 129 void SetDeferResourceLoading(unsigned long resource_id, bool defer) override; | 123 void SetDeferResourceLoading(unsigned long resource_id, bool defer) override; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Given a download request, check if we need to route the output to a frame. | 161 // Given a download request, check if we need to route the output to a frame. |
| 168 // Returns ROUTED if the load is done and routed to a frame, NOT_ROUTED or | 162 // Returns ROUTED if the load is done and routed to a frame, NOT_ROUTED or |
| 169 // corresponding error codes otherwise. | 163 // corresponding error codes otherwise. |
| 170 RoutingStatus RouteToFrame(const char* url, | 164 RoutingStatus RouteToFrame(const char* url, |
| 171 bool is_javascript_url, | 165 bool is_javascript_url, |
| 172 bool popups_allowed, | 166 bool popups_allowed, |
| 173 const char* method, | 167 const char* method, |
| 174 const char* target, | 168 const char* target, |
| 175 const char* buf, | 169 const char* buf, |
| 176 unsigned int len, | 170 unsigned int len, |
| 177 int notify_id, | |
| 178 ReferrerValue referrer_flag); | 171 ReferrerValue referrer_flag); |
| 179 | 172 |
| 180 // Returns the next avaiable resource id. Returns 0 if the operation fails. | 173 // Returns the next avaiable resource id. Returns 0 if the operation fails. |
| 181 // It may fail if the page has already been closed. | 174 // It may fail if the page has already been closed. |
| 182 unsigned long GetNextResourceId(); | 175 unsigned long GetNextResourceId(); |
| 183 | 176 |
| 184 // Initiates HTTP GET/POST requests. | 177 // Initiates HTTP GET/POST requests. |
| 185 // Returns true on success. | 178 // Returns true on success. |
| 186 bool InitiateHTTPRequest(unsigned long resource_id, | 179 bool InitiateHTTPRequest(unsigned long resource_id, |
| 187 WebPluginResourceClient* client, | 180 WebPluginResourceClient* client, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // Returns false if response is not multipart (may be if we requested | 229 // Returns false if response is not multipart (may be if we requested |
| 237 // single range). | 230 // single range). |
| 238 bool HandleHttpMultipartResponse(const blink::WebURLResponse& response, | 231 bool HandleHttpMultipartResponse(const blink::WebURLResponse& response, |
| 239 WebPluginResourceClient* client); | 232 WebPluginResourceClient* client); |
| 240 | 233 |
| 241 void HandleURLRequestInternal(const char* url, | 234 void HandleURLRequestInternal(const char* url, |
| 242 const char* method, | 235 const char* method, |
| 243 const char* target, | 236 const char* target, |
| 244 const char* buf, | 237 const char* buf, |
| 245 unsigned int len, | 238 unsigned int len, |
| 246 int notify_id, | |
| 247 bool popups_allowed, | 239 bool popups_allowed, |
| 248 ReferrerValue referrer_flag, | 240 ReferrerValue referrer_flag, |
| 249 bool notify_redirects, | 241 bool notify_redirects, |
| 250 bool check_mixed_scripting); | 242 bool check_mixed_scripting); |
| 251 | 243 |
| 252 // Tears down the existing plugin instance and creates a new plugin instance | 244 // Tears down the existing plugin instance and creates a new plugin instance |
| 253 // to handle the response identified by the loader parameter. | 245 // to handle the response identified by the loader parameter. |
| 254 bool ReinitializePluginForResponse(blink::WebURLLoader* loader); | 246 bool ReinitializePluginForResponse(blink::WebURLLoader* loader); |
| 255 | 247 |
| 256 // Delayed task for downloading the plugin source URL. | 248 // Delayed task for downloading the plugin source URL. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 LoaderClient loader_client_; | 351 LoaderClient loader_client_; |
| 360 | 352 |
| 361 base::WeakPtrFactory<WebPluginImpl> weak_factory_; | 353 base::WeakPtrFactory<WebPluginImpl> weak_factory_; |
| 362 | 354 |
| 363 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 355 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 364 }; | 356 }; |
| 365 | 357 |
| 366 } // namespace content | 358 } // namespace content |
| 367 | 359 |
| 368 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 360 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |