| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 const blink::WebInputEvent& event, blink::WebCursorInfo& cursor_info); | 84 const blink::WebInputEvent& event, blink::WebCursorInfo& cursor_info); |
| 85 virtual void didReceiveResponse(const blink::WebURLResponse& response); | 85 virtual void didReceiveResponse(const blink::WebURLResponse& response); |
| 86 virtual void didReceiveData(const char* data, int data_length); | 86 virtual void didReceiveData(const char* data, int data_length); |
| 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 virtual void SetWindow(gfx::PluginWindowHandle window) override; |
| 98 virtual void SetAcceptsInputEvents(bool accepts) OVERRIDE; | 98 virtual void SetAcceptsInputEvents(bool accepts) override; |
| 99 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) OVERRIDE; | 99 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) override; |
| 100 virtual void CancelResource(unsigned long id) OVERRIDE; | 100 virtual void CancelResource(unsigned long id) override; |
| 101 virtual void Invalidate() OVERRIDE; | 101 virtual void Invalidate() override; |
| 102 virtual void InvalidateRect(const gfx::Rect& rect) OVERRIDE; | 102 virtual void InvalidateRect(const gfx::Rect& rect) override; |
| 103 virtual NPObject* GetWindowScriptNPObject() OVERRIDE; | 103 virtual NPObject* GetWindowScriptNPObject() override; |
| 104 virtual NPObject* GetPluginElement() OVERRIDE; | 104 virtual NPObject* GetPluginElement() override; |
| 105 virtual bool FindProxyForUrl(const GURL& url, | 105 virtual bool FindProxyForUrl(const GURL& url, |
| 106 std::string* proxy_list) OVERRIDE; | 106 std::string* proxy_list) override; |
| 107 virtual void SetCookie(const GURL& url, | 107 virtual void SetCookie(const GURL& url, |
| 108 const GURL& first_party_for_cookies, | 108 const GURL& first_party_for_cookies, |
| 109 const std::string& cookie) OVERRIDE; | 109 const std::string& cookie) override; |
| 110 virtual std::string GetCookies(const GURL& url, | 110 virtual std::string GetCookies(const GURL& url, |
| 111 const GURL& first_party_for_cookies) OVERRIDE; | 111 const GURL& first_party_for_cookies) override; |
| 112 virtual void HandleURLRequest(const char* url, | 112 virtual void HandleURLRequest(const char* url, |
| 113 const char *method, | 113 const char *method, |
| 114 const char* target, | 114 const char* target, |
| 115 const char* buf, | 115 const char* buf, |
| 116 unsigned int len, | 116 unsigned int len, |
| 117 int notify_id, | 117 int notify_id, |
| 118 bool popups_allowed, | 118 bool popups_allowed, |
| 119 bool notify_redirects) OVERRIDE; | 119 bool notify_redirects) override; |
| 120 virtual void CancelDocumentLoad() OVERRIDE; | 120 virtual void CancelDocumentLoad() override; |
| 121 virtual void InitiateHTTPRangeRequest(const char* url, | 121 virtual void InitiateHTTPRangeRequest(const char* url, |
| 122 const char* range_info, | 122 const char* range_info, |
| 123 int pending_request_id) OVERRIDE; | 123 int pending_request_id) override; |
| 124 virtual void DidStartLoading() OVERRIDE; | 124 virtual void DidStartLoading() override; |
| 125 virtual void DidStopLoading() OVERRIDE; | 125 virtual void DidStopLoading() override; |
| 126 virtual bool IsOffTheRecord() OVERRIDE; | 126 virtual bool IsOffTheRecord() override; |
| 127 virtual void SetDeferResourceLoading(unsigned long resource_id, | 127 virtual void SetDeferResourceLoading(unsigned long resource_id, |
| 128 bool defer) OVERRIDE; | 128 bool defer) override; |
| 129 virtual void URLRedirectResponse(bool allow, int resource_id) OVERRIDE; | 129 virtual void URLRedirectResponse(bool allow, int resource_id) override; |
| 130 virtual bool CheckIfRunInsecureContent(const GURL& url) OVERRIDE; | 130 virtual bool CheckIfRunInsecureContent(const GURL& url) override; |
| 131 #if defined(OS_WIN) | 131 #if defined(OS_WIN) |
| 132 void SetWindowlessData(HANDLE pump_messages_event, | 132 void SetWindowlessData(HANDLE pump_messages_event, |
| 133 gfx::NativeViewId dummy_activation_window) { } | 133 gfx::NativeViewId dummy_activation_window) { } |
| 134 void ReparentPluginWindow(HWND window, HWND parent) { } | 134 void ReparentPluginWindow(HWND window, HWND parent) { } |
| 135 void ReportExecutableMemory(size_t size) { } | 135 void ReportExecutableMemory(size_t size) { } |
| 136 #endif | 136 #endif |
| 137 #if defined(OS_MACOSX) | 137 #if defined(OS_MACOSX) |
| 138 virtual WebPluginAcceleratedSurface* GetAcceleratedSurface( | 138 virtual WebPluginAcceleratedSurface* GetAcceleratedSurface( |
| 139 gfx::GpuPreference gpu_preference) OVERRIDE; | 139 gfx::GpuPreference gpu_preference) override; |
| 140 virtual void AcceleratedPluginEnabledRendering() OVERRIDE; | 140 virtual void AcceleratedPluginEnabledRendering() override; |
| 141 virtual void AcceleratedPluginAllocatedIOSurface(int32 width, | 141 virtual void AcceleratedPluginAllocatedIOSurface(int32 width, |
| 142 int32 height, | 142 int32 height, |
| 143 uint32 surface_id) OVERRIDE; | 143 uint32 surface_id) override; |
| 144 virtual void AcceleratedPluginSwappedIOSurface() OVERRIDE; | 144 virtual void AcceleratedPluginSwappedIOSurface() override; |
| 145 #endif | 145 #endif |
| 146 | 146 |
| 147 private: | 147 private: |
| 148 // Given a (maybe partial) url, completes using the base url. | 148 // Given a (maybe partial) url, completes using the base url. |
| 149 GURL CompleteURL(const char* url); | 149 GURL CompleteURL(const char* url); |
| 150 | 150 |
| 151 enum RoutingStatus { | 151 enum RoutingStatus { |
| 152 ROUTED, | 152 ROUTED, |
| 153 NOT_ROUTED, | 153 NOT_ROUTED, |
| 154 INVALID_URL, | 154 INVALID_URL, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // these so that we can re-initialize the plugin if we need to. | 323 // these so that we can re-initialize the plugin if we need to. |
| 324 std::vector<std::string> arg_names_; | 324 std::vector<std::string> arg_names_; |
| 325 std::vector<std::string> arg_values_; | 325 std::vector<std::string> arg_values_; |
| 326 | 326 |
| 327 class LoaderClient : public blink::WebURLLoaderClient { | 327 class LoaderClient : public blink::WebURLLoaderClient { |
| 328 public: | 328 public: |
| 329 LoaderClient(WebPluginImpl*); | 329 LoaderClient(WebPluginImpl*); |
| 330 | 330 |
| 331 virtual void willSendRequest(blink::WebURLLoader*, | 331 virtual void willSendRequest(blink::WebURLLoader*, |
| 332 blink::WebURLRequest&, | 332 blink::WebURLRequest&, |
| 333 const blink::WebURLResponse&) OVERRIDE; | 333 const blink::WebURLResponse&) override; |
| 334 virtual void didSendData(blink::WebURLLoader*, | 334 virtual void didSendData(blink::WebURLLoader*, |
| 335 unsigned long long bytesSent, | 335 unsigned long long bytesSent, |
| 336 unsigned long long totalBytesToBeSent) OVERRIDE; | 336 unsigned long long totalBytesToBeSent) override; |
| 337 virtual void didReceiveResponse(blink::WebURLLoader*, | 337 virtual void didReceiveResponse(blink::WebURLLoader*, |
| 338 const blink::WebURLResponse&) OVERRIDE; | 338 const blink::WebURLResponse&) override; |
| 339 virtual void didDownloadData(blink::WebURLLoader*, | 339 virtual void didDownloadData(blink::WebURLLoader*, |
| 340 int dataLength, | 340 int dataLength, |
| 341 int encodedDataLength) OVERRIDE; | 341 int encodedDataLength) override; |
| 342 virtual void didReceiveData(blink::WebURLLoader*, | 342 virtual void didReceiveData(blink::WebURLLoader*, |
| 343 const char* data, | 343 const char* data, |
| 344 int dataLength, | 344 int dataLength, |
| 345 int encodedDataLength) OVERRIDE; | 345 int encodedDataLength) override; |
| 346 virtual void didReceiveCachedMetadata(blink::WebURLLoader*, | 346 virtual void didReceiveCachedMetadata(blink::WebURLLoader*, |
| 347 const char* data, | 347 const char* data, |
| 348 int dataLength) OVERRIDE; | 348 int dataLength) override; |
| 349 virtual void didFinishLoading(blink::WebURLLoader*, | 349 virtual void didFinishLoading(blink::WebURLLoader*, |
| 350 double finishTime, | 350 double finishTime, |
| 351 int64_t total_encoded_data_length) OVERRIDE; | 351 int64_t total_encoded_data_length) override; |
| 352 virtual void didFail(blink::WebURLLoader*, | 352 virtual void didFail(blink::WebURLLoader*, |
| 353 const blink::WebURLError&) OVERRIDE; | 353 const blink::WebURLError&) override; |
| 354 | 354 |
| 355 private: | 355 private: |
| 356 WebPluginImpl* parent_; | 356 WebPluginImpl* parent_; |
| 357 }; | 357 }; |
| 358 | 358 |
| 359 LoaderClient loader_client_; | 359 LoaderClient loader_client_; |
| 360 | 360 |
| 361 base::WeakPtrFactory<WebPluginImpl> weak_factory_; | 361 base::WeakPtrFactory<WebPluginImpl> weak_factory_; |
| 362 | 362 |
| 363 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 363 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 } // namespace content | 366 } // namespace content |
| 367 | 367 |
| 368 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ | 368 #endif // CONTENT_RENDERER_NPAPI_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |