| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| 7 | 7 |
| 8 #include "third_party/WebKit/public/web/WebPlugin.h" | 8 #include "third_party/WebKit/public/web/WebPlugin.h" |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const blink::WebString& text, | 122 const blink::WebString& text, |
| 123 const blink::WebVector<blink::WebCompositionUnderline>& underlines, | 123 const blink::WebVector<blink::WebCompositionUnderline>& underlines, |
| 124 int selectionStart, | 124 int selectionStart, |
| 125 int selectionEnd) override; | 125 int selectionEnd) override; |
| 126 virtual bool confirmComposition( | 126 virtual bool confirmComposition( |
| 127 const blink::WebString& text, | 127 const blink::WebString& text, |
| 128 blink::WebWidget::ConfirmCompositionBehavior selectionBehavior) override; | 128 blink::WebWidget::ConfirmCompositionBehavior selectionBehavior) override; |
| 129 virtual void extendSelectionAndDelete(int before, int after) override; | 129 virtual void extendSelectionAndDelete(int before, int after) override; |
| 130 | 130 |
| 131 // MouseLockDispatcher::LockTarget implementation. | 131 // MouseLockDispatcher::LockTarget implementation. |
| 132 virtual void OnLockMouseACK(bool succeeded) override; | 132 void OnLockMouseACK(bool succeeded) override; |
| 133 virtual void OnMouseLockLost() override; | 133 void OnMouseLockLost() override; |
| 134 virtual bool HandleMouseLockedInputEvent( | 134 bool HandleMouseLockedInputEvent(const blink::WebMouseEvent& event) override; |
| 135 const blink::WebMouseEvent& event) override; | |
| 136 | 135 |
| 137 private: | 136 private: |
| 138 friend class base::DeleteHelper<BrowserPlugin>; | 137 friend class base::DeleteHelper<BrowserPlugin>; |
| 139 // Only the manager is allowed to create a BrowserPlugin. | 138 // Only the manager is allowed to create a BrowserPlugin. |
| 140 friend class BrowserPluginManager; | 139 friend class BrowserPluginManager; |
| 141 | 140 |
| 142 // For unit/integration tests. | 141 // For unit/integration tests. |
| 143 friend class MockBrowserPlugin; | 142 friend class MockBrowserPlugin; |
| 144 | 143 |
| 145 // A BrowserPlugin object is a controller that represents an instance of a | 144 // A BrowserPlugin object is a controller that represents an instance of a |
| 146 // browser plugin within the embedder renderer process. Once a BrowserPlugin | 145 // browser plugin within the embedder renderer process. Once a BrowserPlugin |
| 147 // does an initial navigation or is attached to a newly created guest, it | 146 // does an initial navigation or is attached to a newly created guest, it |
| 148 // acquires a browser_plugin_instance_id as well. The guest instance ID | 147 // acquires a browser_plugin_instance_id as well. The guest instance ID |
| 149 // uniquely identifies a guest WebContents that's hosted by this | 148 // uniquely identifies a guest WebContents that's hosted by this |
| 150 // BrowserPlugin. | 149 // BrowserPlugin. |
| 151 BrowserPlugin(RenderViewImpl* render_view, | 150 BrowserPlugin(RenderViewImpl* render_view, |
| 152 blink::WebFrame* frame, | 151 blink::WebFrame* frame, |
| 153 scoped_ptr<BrowserPluginDelegate> delegate); | 152 scoped_ptr<BrowserPluginDelegate> delegate); |
| 154 | 153 |
| 155 virtual ~BrowserPlugin(); | 154 ~BrowserPlugin() override; |
| 156 | 155 |
| 157 int width() const { return plugin_rect_.width(); } | 156 int width() const { return plugin_rect_.width(); } |
| 158 int height() const { return plugin_rect_.height(); } | 157 int height() const { return plugin_rect_.height(); } |
| 159 gfx::Size plugin_size() const { return plugin_rect_.size(); } | 158 gfx::Size plugin_size() const { return plugin_rect_.size(); } |
| 160 gfx::Rect plugin_rect() const { return plugin_rect_; } | 159 gfx::Rect plugin_rect() const { return plugin_rect_; } |
| 161 | 160 |
| 162 float GetDeviceScaleFactor() const; | 161 float GetDeviceScaleFactor() const; |
| 163 | 162 |
| 164 void ShowSadGraphic(); | 163 void ShowSadGraphic(); |
| 165 | 164 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 232 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
| 234 // get called after BrowserPlugin has been destroyed. | 233 // get called after BrowserPlugin has been destroyed. |
| 235 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 234 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
| 236 | 235 |
| 237 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 236 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 238 }; | 237 }; |
| 239 | 238 |
| 240 } // namespace content | 239 } // namespace content |
| 241 | 240 |
| 242 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 241 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |