| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Currently we are only interested in checking for the escape key to | 60 // Currently we are only interested in checking for the escape key to |
| 61 // unlock hte guest's pointer lock. | 61 // unlock hte guest's pointer lock. |
| 62 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 62 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 63 | 63 |
| 64 // Overrides factory for testing. Default (NULL) value indicates regular | 64 // Overrides factory for testing. Default (NULL) value indicates regular |
| 65 // (non-test) environment. | 65 // (non-test) environment. |
| 66 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { | 66 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { |
| 67 factory_ = factory; | 67 factory_ = factory; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Sets the zoom level for all guests within this embedder. |
| 71 void SetZoomLevel(double level); |
| 72 |
| 70 // WebContentsObserver implementation. | 73 // WebContentsObserver implementation. |
| 71 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 74 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
| 72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 75 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 73 | 76 |
| 74 void DragSourceEndedAt(int client_x, int client_y, int screen_x, | 77 void DragSourceEndedAt(int client_x, int client_y, int screen_x, |
| 75 int screen_y, blink::WebDragOperation operation); | 78 int screen_y, blink::WebDragOperation operation); |
| 76 | 79 |
| 77 void DragSourceMovedTo(int client_x, int client_y, | 80 void DragSourceMovedTo(int client_x, int client_y, |
| 78 int screen_x, int screen_y); | 81 int screen_x, int screen_y); |
| 79 | 82 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 91 | 94 |
| 92 private: | 95 private: |
| 93 friend class TestBrowserPluginEmbedder; | 96 friend class TestBrowserPluginEmbedder; |
| 94 | 97 |
| 95 BrowserPluginEmbedder(WebContentsImpl* web_contents); | 98 BrowserPluginEmbedder(WebContentsImpl* web_contents); |
| 96 | 99 |
| 97 void CleanUp(); | 100 void CleanUp(); |
| 98 | 101 |
| 99 BrowserPluginGuestManager* GetBrowserPluginGuestManager(); | 102 BrowserPluginGuestManager* GetBrowserPluginGuestManager(); |
| 100 | 103 |
| 104 void GuestCallbackSetZoomLevel(double level, BrowserPluginGuest* guest); |
| 105 |
| 101 // Message handlers. | 106 // Message handlers. |
| 102 | 107 |
| 103 void OnAllocateInstanceID(int request_id); | 108 void OnAllocateInstanceID(int request_id); |
| 104 void OnAttach(int instance_id, | 109 void OnAttach(int instance_id, |
| 105 const BrowserPluginHostMsg_Attach_Params& params, | 110 const BrowserPluginHostMsg_Attach_Params& params, |
| 106 const base::DictionaryValue& extra_params); | 111 const base::DictionaryValue& extra_params); |
| 107 void OnPluginAtPositionResponse(int instance_id, | 112 void OnPluginAtPositionResponse(int instance_id, |
| 108 int request_id, | 113 int request_id, |
| 109 const gfx::Point& position); | 114 const gfx::Point& position); |
| 110 | 115 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 130 // Pointer to the guest that started the drag, used to forward necessary drag | 135 // Pointer to the guest that started the drag, used to forward necessary drag |
| 131 // status messages to the correct guest. | 136 // status messages to the correct guest. |
| 132 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 137 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
| 133 | 138 |
| 134 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 139 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
| 135 }; | 140 }; |
| 136 | 141 |
| 137 } // namespace content | 142 } // namespace content |
| 138 | 143 |
| 139 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 144 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
| OLD | NEW |