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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 void StartDrag(BrowserPluginGuest* guest); | 64 void StartDrag(BrowserPluginGuest* guest); |
65 | 65 |
66 // Sends EndSystemDrag message to the guest that initiated the last drag/drop | 66 // Sends EndSystemDrag message to the guest that initiated the last drag/drop |
67 // operation, if there's any. | 67 // operation, if there's any. |
68 void SystemDragEnded(); | 68 void SystemDragEnded(); |
69 | 69 |
70 // Used to handle special keyboard events. | 70 // Used to handle special keyboard events. |
71 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 71 bool HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
72 | 72 |
| 73 // Find the given |search_text| in the page. Returns true if the find request |
| 74 // is handled by this browser plugin embedder. |
| 75 bool Find(int request_id, |
| 76 const base::string16& search_text, |
| 77 const blink::WebFindOptions& options); |
| 78 |
73 private: | 79 private: |
74 explicit BrowserPluginEmbedder(WebContentsImpl* web_contents); | 80 explicit BrowserPluginEmbedder(WebContentsImpl* web_contents); |
75 | 81 |
76 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; | 82 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; |
77 | 83 |
78 void ClearGuestDragStateIfApplicable(); | 84 void ClearGuestDragStateIfApplicable(); |
79 | 85 |
80 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); | 86 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); |
81 | 87 |
82 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); | 88 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); |
83 | 89 |
84 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); | 90 bool FindInGuest(int request_id, |
| 91 const base::string16& search_text, |
| 92 const blink::WebFindOptions& options, |
| 93 WebContents* guest); |
85 | 94 |
86 // Message handlers. | 95 // Message handlers. |
87 void OnAttach(int instance_id, | 96 void OnAttach(int instance_id, |
88 const BrowserPluginHostMsg_Attach_Params& params); | 97 const BrowserPluginHostMsg_Attach_Params& params); |
89 void OnPluginAtPositionResponse(int instance_id, | 98 void OnPluginAtPositionResponse(int instance_id, |
90 int request_id, | 99 int request_id, |
91 const gfx::Point& position); | 100 const gfx::Point& position); |
92 | 101 |
93 // Used to correctly update the cursor when dragging over a guest, and to | 102 // Used to correctly update the cursor when dragging over a guest, and to |
94 // handle a race condition when dropping onto the guest that started the drag | 103 // handle a race condition when dropping onto the guest that started the drag |
(...skipping 10 matching lines...) Expand all Loading... |
105 bool guest_drag_ending_; | 114 bool guest_drag_ending_; |
106 | 115 |
107 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 116 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
108 | 117 |
109 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 118 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
110 }; | 119 }; |
111 | 120 |
112 } // namespace content | 121 } // namespace content |
113 | 122 |
114 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 123 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |