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 13 matching lines...) Expand all Loading... |
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 |
101 bool DidSendScreenRectsCallback(BrowserPluginGuest* guest); | 104 bool DidSendScreenRectsCallback(BrowserPluginGuest* guest); |
102 | 105 |
| 106 bool SetZoomLevelCallback(double level, BrowserPluginGuest* guest); |
| 107 |
103 bool UnlockMouseIfNecessaryCallback(const NativeWebKeyboardEvent& event, | 108 bool UnlockMouseIfNecessaryCallback(const NativeWebKeyboardEvent& event, |
104 BrowserPluginGuest* guest); | 109 BrowserPluginGuest* guest); |
105 | 110 |
106 // Message handlers. | 111 // Message handlers. |
107 | 112 |
108 void OnAllocateInstanceID(int request_id); | 113 void OnAllocateInstanceID(int request_id); |
109 void OnAttach(int instance_id, | 114 void OnAttach(int instance_id, |
110 const BrowserPluginHostMsg_Attach_Params& params, | 115 const BrowserPluginHostMsg_Attach_Params& params, |
111 const base::DictionaryValue& extra_params); | 116 const base::DictionaryValue& extra_params); |
112 void OnPluginAtPositionResponse(int instance_id, | 117 void OnPluginAtPositionResponse(int instance_id, |
(...skipping 22 matching lines...) Expand all Loading... |
135 // Pointer to the guest that started the drag, used to forward necessary drag | 140 // Pointer to the guest that started the drag, used to forward necessary drag |
136 // status messages to the correct guest. | 141 // status messages to the correct guest. |
137 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 142 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
138 | 143 |
139 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 144 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
140 }; | 145 }; |
141 | 146 |
142 } // namespace content | 147 } // namespace content |
143 | 148 |
144 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 149 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |