| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ | 5 #ifndef COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ |
| 6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ | 6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" |
| 11 #include "base/sequenced_task_runner_helpers.h" | 12 #include "base/sequenced_task_runner_helpers.h" |
| 12 #include "content/public/renderer/render_view_observer.h" | 13 #include "content/public/renderer/render_view_observer.h" |
| 13 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 14 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 14 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
| 15 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 16 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 16 #include "third_party/WebKit/public/web/WebFrameClient.h" | 17 #include "third_party/WebKit/public/web/WebFrameClient.h" |
| 17 #include "third_party/WebKit/public/web/WebKit.h" | 18 #include "third_party/WebKit/public/web/WebKit.h" |
| 18 #include "third_party/WebKit/public/web/WebPlugin.h" | 19 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 19 #include "third_party/WebKit/public/web/WebViewClient.h" | 20 #include "third_party/WebKit/public/web/WebViewClient.h" |
| 20 | 21 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 friend class base::DeleteHelper<WebViewPlugin>; | 148 friend class base::DeleteHelper<WebViewPlugin>; |
| 148 WebViewPlugin(content::RenderView* render_view, | 149 WebViewPlugin(content::RenderView* render_view, |
| 149 Delegate* delegate, | 150 Delegate* delegate, |
| 150 const content::WebPreferences& preferences); | 151 const content::WebPreferences& preferences); |
| 151 ~WebViewPlugin() override; | 152 ~WebViewPlugin() override; |
| 152 | 153 |
| 153 // content::RenderViewObserver methods: | 154 // content::RenderViewObserver methods: |
| 154 void OnDestruct() override; | 155 void OnDestruct() override; |
| 155 void OnZoomLevelChanged() override; | 156 void OnZoomLevelChanged() override; |
| 156 | 157 |
| 158 void UpdatePluginForNewGeometry(const blink::WebRect& window_rect, |
| 159 const blink::WebRect& unobscured_rect); |
| 160 |
| 157 // Manages its own lifetime. | 161 // Manages its own lifetime. |
| 158 Delegate* delegate_; | 162 Delegate* delegate_; |
| 159 | 163 |
| 160 blink::WebCursorInfo current_cursor_; | 164 blink::WebCursorInfo current_cursor_; |
| 161 | 165 |
| 162 // Owns us. | 166 // Owns us. |
| 163 blink::WebPluginContainer* container_; | 167 blink::WebPluginContainer* container_; |
| 164 | 168 |
| 165 // Owned by us, deleted via |close()|. | 169 // Owned by us, deleted via |close()|. |
| 166 blink::WebView* web_view_; | 170 blink::WebView* web_view_; |
| 167 | 171 |
| 168 // Owned by us, deleted via |close()|. | 172 // Owned by us, deleted via |close()|. |
| 169 blink::WebFrameWidget* web_frame_widget_; | 173 blink::WebFrameWidget* web_frame_widget_; |
| 170 | 174 |
| 171 // Owned by us, deleted via |close()|. | 175 // Owned by us, deleted via |close()|. |
| 172 blink::WebFrame* web_frame_; | 176 blink::WebFrame* web_frame_; |
| 173 gfx::Rect rect_; | 177 gfx::Rect rect_; |
| 174 | 178 |
| 175 blink::WebURLResponse response_; | 179 blink::WebURLResponse response_; |
| 176 std::list<std::string> data_; | 180 std::list<std::string> data_; |
| 177 std::unique_ptr<blink::WebURLError> error_; | 181 std::unique_ptr<blink::WebURLError> error_; |
| 178 blink::WebString old_title_; | 182 blink::WebString old_title_; |
| 179 bool finished_loading_; | 183 bool finished_loading_; |
| 180 bool focused_; | 184 bool focused_; |
| 181 bool is_painting_; | 185 bool is_painting_; |
| 182 bool is_resizing_; | 186 bool is_resizing_; |
| 187 |
| 188 // Should be invalidated when destroy() is called. |
| 189 base::WeakPtrFactory<WebViewPlugin> weak_factory_; |
| 183 }; | 190 }; |
| 184 | 191 |
| 185 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ | 192 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ |
| OLD | NEW |