Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.h

Issue 511643002: BrowserPlugin: Simplify guest access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_embedder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; 76 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const;
77 77
78 void ClearGuestDragStateIfApplicable(); 78 void ClearGuestDragStateIfApplicable();
79 79
80 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); 80 bool DidSendScreenRectsCallback(WebContents* guest_web_contents);
81 81
82 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); 82 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents);
83 83
84 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest); 84 bool UnlockMouseIfNecessaryCallback(bool* mouse_unlocked, WebContents* guest);
85 85
86 // Called by the content embedder when a guest exists with the provided
87 // |instance_id|.
88 void OnGuestCallback(int instance_id,
89 const BrowserPluginHostMsg_Attach_Params& params,
90 WebContents* guest_web_contents);
91
92 // Message handlers. 86 // Message handlers.
93
94 void OnAttach(int instance_id, 87 void OnAttach(int instance_id,
95 const BrowserPluginHostMsg_Attach_Params& params); 88 const BrowserPluginHostMsg_Attach_Params& params);
96 void OnPluginAtPositionResponse(int instance_id, 89 void OnPluginAtPositionResponse(int instance_id,
97 int request_id, 90 int request_id,
98 const gfx::Point& position); 91 const gfx::Point& position);
99 92
100 // Used to correctly update the cursor when dragging over a guest, and to 93 // Used to correctly update the cursor when dragging over a guest, and to
101 // handle a race condition when dropping onto the guest that started the drag 94 // handle a race condition when dropping onto the guest that started the drag
102 // (the race is that the dragend message arrives before the drop message so 95 // (the race is that the dragend message arrives before the drop message so
103 // the drop never takes place). 96 // the drop never takes place).
104 // crbug.com/233571 97 // crbug.com/233571
105 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_; 98 base::WeakPtr<BrowserPluginGuest> guest_dragging_over_;
106 99
107 // Pointer to the guest that started the drag, used to forward necessary drag 100 // Pointer to the guest that started the drag, used to forward necessary drag
108 // status messages to the correct guest. 101 // status messages to the correct guest.
109 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; 102 base::WeakPtr<BrowserPluginGuest> guest_started_drag_;
110 103
111 // Keeps track of "dragend" state. 104 // Keeps track of "dragend" state.
112 bool guest_drag_ending_; 105 bool guest_drag_ending_;
113 106
114 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; 107 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_;
115 108
116 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); 109 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder);
117 }; 110 };
118 111
119 } // namespace content 112 } // namespace content
120 113
121 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ 114 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/browser_plugin/browser_plugin_embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698