| 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 // A BrowserPluginEmbedder handles messages coming from a BrowserPlugin's | 5 // A BrowserPluginEmbedder handles messages coming from a BrowserPlugin's |
| 6 // embedder that are not directed at any particular existing guest process. | 6 // embedder that are not directed at any particular existing guest process. |
| 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer | 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer |
| 8 // process requests an initial navigation, the WebContents for that renderer | 8 // process requests an initial navigation, the WebContents for that renderer |
| 9 // renderer creates a BrowserPluginEmbedder for itself. The | 9 // renderer creates a BrowserPluginEmbedder for itself. The |
| 10 // BrowserPluginEmbedder, in turn, forwards the requests to a | 10 // BrowserPluginEmbedder, in turn, forwards the requests to a |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual ~BrowserPluginEmbedder(); | 43 virtual ~BrowserPluginEmbedder(); |
| 44 | 44 |
| 45 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); | 45 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); |
| 46 | 46 |
| 47 // Returns this embedder's WebContentsImpl. | 47 // Returns this embedder's WebContentsImpl. |
| 48 WebContentsImpl* GetWebContents() const; | 48 WebContentsImpl* GetWebContents() const; |
| 49 | 49 |
| 50 // Called when embedder's |rwh| has sent screen rects to renderer. | 50 // Called when embedder's |rwh| has sent screen rects to renderer. |
| 51 void DidSendScreenRects(); | 51 void DidSendScreenRects(); |
| 52 | 52 |
| 53 // Called when embedder's WebContentsImpl has unhandled keyboard input. | |
| 54 // Returns whether the BrowserPlugin has handled the keyboard event. | |
| 55 // Currently we are only interested in checking for the escape key to | |
| 56 // unlock hte guest's pointer lock. | |
| 57 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | |
| 58 | |
| 59 // Overrides factory for testing. Default (NULL) value indicates regular | 53 // Overrides factory for testing. Default (NULL) value indicates regular |
| 60 // (non-test) environment. | 54 // (non-test) environment. |
| 61 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { | 55 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { |
| 62 factory_ = factory; | 56 factory_ = factory; |
| 63 } | 57 } |
| 64 | 58 |
| 65 // Sets the zoom level for all guests within this embedder. | 59 // Sets the zoom level for all guests within this embedder. |
| 66 void SetZoomLevel(double level); | 60 void SetZoomLevel(double level); |
| 67 | 61 |
| 68 // WebContentsObserver implementation. | 62 // WebContentsObserver implementation. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 123 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
| 130 | 124 |
| 131 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 125 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
| 132 | 126 |
| 133 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 127 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 134 }; | 128 }; |
| 135 | 129 |
| 136 } // namespace content | 130 } // namespace content |
| 137 | 131 |
| 138 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 132 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |