| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual void didFinishLoadingFrameRequest( | 86 virtual void didFinishLoadingFrameRequest( |
| 87 const WebKit::WebURL& url, void* notify_data); | 87 const WebKit::WebURL& url, void* notify_data); |
| 88 virtual void didFailLoadingFrameRequest( | 88 virtual void didFailLoadingFrameRequest( |
| 89 const WebKit::WebURL& url, void* notify_data, | 89 const WebKit::WebURL& url, void* notify_data, |
| 90 const WebKit::WebURLError& error); | 90 const WebKit::WebURLError& error); |
| 91 virtual bool supportsPaginatedPrint(); | 91 virtual bool supportsPaginatedPrint(); |
| 92 virtual int printBegin(const WebKit::WebRect& printable_area, | 92 virtual int printBegin(const WebKit::WebRect& printable_area, |
| 93 int printer_dpi); | 93 int printer_dpi); |
| 94 virtual bool printPage(int page_number, WebKit::WebCanvas* canvas); | 94 virtual bool printPage(int page_number, WebKit::WebCanvas* canvas); |
| 95 virtual void printEnd(); | 95 virtual void printEnd(); |
| 96 virtual WebKit::WebString selectedText(); | 96 virtual bool hasSelection() const; |
| 97 virtual WebKit::WebString selectionAsText() const; |
| 98 virtual WebKit::WebString selectionAsMarkup() const; |
| 99 virtual void setZoomFactor(float scale, bool text_only); |
| 100 virtual bool supportsFind(); |
| 101 virtual void startFind(const WebKit::WebString& search_text, |
| 102 bool case_sensitive, |
| 103 int identifier); |
| 104 virtual void selectFindResult(bool forward); |
| 105 virtual void stopFind(); |
| 97 | 106 |
| 98 // WebPlugin implementation: | 107 // WebPlugin implementation: |
| 99 void SetWindow(gfx::PluginWindowHandle window); | 108 void SetWindow(gfx::PluginWindowHandle window); |
| 100 | |
| 101 // Whether input events should be sent to the delegate. | |
| 102 virtual void SetAcceptsInputEvents(bool accepts) { | 109 virtual void SetAcceptsInputEvents(bool accepts) { |
| 103 accepts_input_events_ = accepts; | 110 accepts_input_events_ = accepts; |
| 104 } | 111 } |
| 105 | |
| 106 void WillDestroyWindow(gfx::PluginWindowHandle window); | 112 void WillDestroyWindow(gfx::PluginWindowHandle window); |
| 107 #if defined(OS_WIN) | 113 #if defined(OS_WIN) |
| 108 void SetWindowlessPumpEvent(HANDLE pump_messages_event) { } | 114 void SetWindowlessPumpEvent(HANDLE pump_messages_event) { } |
| 109 #endif | 115 #endif |
| 116 virtual void CancelResource(unsigned long id); |
| 117 virtual void Invalidate(); |
| 118 virtual void InvalidateRect(const gfx::Rect& rect); |
| 119 virtual NPObject* GetWindowScriptNPObject(); |
| 120 virtual NPObject* GetPluginElement(); |
| 121 virtual void SetCookie(const GURL& url, |
| 122 const GURL& first_party_for_cookies, |
| 123 const std::string& cookie); |
| 124 virtual std::string GetCookies(const GURL& url, |
| 125 const GURL& first_party_for_cookies); |
| 126 virtual void ShowModalHTMLDialog(const GURL& url, int width, int height, |
| 127 const std::string& json_arguments, |
| 128 std::string* json_retval); |
| 129 virtual void OnMissingPluginStatus(int status); |
| 110 | 130 |
| 111 // Given a (maybe partial) url, completes using the base url. | 131 // Given a (maybe partial) url, completes using the base url. |
| 112 GURL CompleteURL(const char* url); | 132 GURL CompleteURL(const char* url); |
| 113 | 133 |
| 114 // Executes the script passed in. The notify_needed and notify_data arguments | 134 // Executes the script passed in. The notify_needed and notify_data arguments |
| 115 // are passed in by the plugin process. These indicate whether the plugin | 135 // are passed in by the plugin process. These indicate whether the plugin |
| 116 // expects a notification on script execution. We pass them back to the | 136 // expects a notification on script execution. We pass them back to the |
| 117 // plugin as is. This avoids having to track the notification arguments in | 137 // plugin as is. This avoids having to track the notification arguments in |
| 118 // the plugin process. | 138 // the plugin process. |
| 119 bool ExecuteScript(const std::string& url, const std::wstring& script, | 139 bool ExecuteScript(const std::string& url, const std::wstring& script, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 140 // corresponding error codes otherwise. | 160 // corresponding error codes otherwise. |
| 141 RoutingStatus RouteToFrame(const char* url, | 161 RoutingStatus RouteToFrame(const char* url, |
| 142 bool is_javascript_url, | 162 bool is_javascript_url, |
| 143 const char* method, | 163 const char* method, |
| 144 const char* target, | 164 const char* target, |
| 145 const char* buf, | 165 const char* buf, |
| 146 unsigned int len, | 166 unsigned int len, |
| 147 int notify_id, | 167 int notify_id, |
| 148 Referrer referrer_flag); | 168 Referrer referrer_flag); |
| 149 | 169 |
| 150 // Cancels a pending request. | |
| 151 void CancelResource(unsigned long id); | |
| 152 | |
| 153 // Returns the next avaiable resource id. Returns 0 if the operation fails. | 170 // Returns the next avaiable resource id. Returns 0 if the operation fails. |
| 154 // It may fail if the page has already been closed. | 171 // It may fail if the page has already been closed. |
| 155 unsigned long GetNextResourceId(); | 172 unsigned long GetNextResourceId(); |
| 156 | 173 |
| 157 // Initiates HTTP GET/POST requests. | 174 // Initiates HTTP GET/POST requests. |
| 158 // Returns true on success. | 175 // Returns true on success. |
| 159 bool InitiateHTTPRequest(unsigned long resource_id, | 176 bool InitiateHTTPRequest(unsigned long resource_id, |
| 160 WebPluginResourceClient* client, | 177 WebPluginResourceClient* client, |
| 161 const GURL& url, | 178 const GURL& url, |
| 162 const char* method, | 179 const char* method, |
| 163 const char* buf, | 180 const char* buf, |
| 164 int len, | 181 int len, |
| 165 const char* range_info, | 182 const char* range_info, |
| 166 Referrer referrer_flag); | 183 Referrer referrer_flag); |
| 167 | 184 |
| 168 gfx::Rect GetWindowClipRect(const gfx::Rect& rect); | 185 gfx::Rect GetWindowClipRect(const gfx::Rect& rect); |
| 169 | 186 |
| 170 NPObject* GetWindowScriptNPObject(); | |
| 171 NPObject* GetPluginElement(); | |
| 172 | |
| 173 void SetCookie(const GURL& url, | |
| 174 const GURL& first_party_for_cookies, | |
| 175 const std::string& cookie); | |
| 176 std::string GetCookies(const GURL& url, | |
| 177 const GURL& first_party_for_cookies); | |
| 178 | |
| 179 void ShowModalHTMLDialog(const GURL& url, int width, int height, | |
| 180 const std::string& json_arguments, | |
| 181 std::string* json_retval); | |
| 182 void OnMissingPluginStatus(int status); | |
| 183 void Invalidate(); | |
| 184 void InvalidateRect(const gfx::Rect& rect); | |
| 185 | |
| 186 // Sets the actual Widget for the plugin. | 187 // Sets the actual Widget for the plugin. |
| 187 void SetContainer(WebKit::WebPluginContainer* container); | 188 void SetContainer(WebKit::WebPluginContainer* container); |
| 188 | 189 |
| 189 // Destroys the plugin instance. | 190 // Destroys the plugin instance. |
| 190 // The response_handle_to_ignore parameter if not NULL indicates the | 191 // The response_handle_to_ignore parameter if not NULL indicates the |
| 191 // resource handle to be left valid during plugin shutdown. | 192 // resource handle to be left valid during plugin shutdown. |
| 192 void TearDownPluginInstance(WebKit::WebURLLoader* loader_to_ignore); | 193 void TearDownPluginInstance(WebKit::WebURLLoader* loader_to_ignore); |
| 193 | 194 |
| 194 // WebURLLoaderClient implementation. We implement this interface in the | 195 // WebURLLoaderClient implementation. We implement this interface in the |
| 195 // renderer process, and then use the simple WebPluginResourceClient interface | 196 // renderer process, and then use the simple WebPluginResourceClient interface |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 std::vector<std::string> arg_values_; | 324 std::vector<std::string> arg_values_; |
| 324 | 325 |
| 325 ScopedRunnableMethodFactory<WebPluginImpl> method_factory_; | 326 ScopedRunnableMethodFactory<WebPluginImpl> method_factory_; |
| 326 | 327 |
| 327 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); | 328 DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); |
| 328 }; | 329 }; |
| 329 | 330 |
| 330 } // namespace webkit_glue | 331 } // namespace webkit_glue |
| 331 | 332 |
| 332 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ | 333 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_IMPL_H_ |
| OLD | NEW |