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

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

Issue 11360106: Browser Plugin: Implement AutoSize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 8 years, 1 month 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 | Annotate | Revision Log
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 BrowserPluginGuest represents the browser side of browser <--> renderer 5 // A BrowserPluginGuest represents the browser side of browser <--> renderer
6 // communication. A BrowserPlugin (a WebPlugin) is on the renderer side of 6 // communication. A BrowserPlugin (a WebPlugin) is on the renderer side of
7 // browser <--> guest renderer communication. The 'guest' renderer is a 7 // browser <--> guest renderer communication. The 'guest' renderer is a
8 // <browser> tag. 8 // <browser> tag.
9 // 9 //
10 // BrowserPluginGuest lives on the UI thread of the browser process. It has a 10 // BrowserPluginGuest lives on the UI thread of the browser process. It has a
(...skipping 25 matching lines...) Expand all
36 #include "base/time.h" 36 #include "base/time.h"
37 #include "content/public/browser/notification_observer.h" 37 #include "content/public/browser/notification_observer.h"
38 #include "content/public/browser/notification_registrar.h" 38 #include "content/public/browser/notification_registrar.h"
39 #include "content/public/browser/web_contents_delegate.h" 39 #include "content/public/browser/web_contents_delegate.h"
40 #include "content/public/browser/web_contents_observer.h" 40 #include "content/public/browser/web_contents_observer.h"
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h"
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
43 #include "ui/gfx/rect.h" 43 #include "ui/gfx/rect.h"
44 #include "webkit/glue/webcursor.h" 44 #include "webkit/glue/webcursor.h"
45 45
46 struct BrowserPluginHostMsg_AutoSize_Params;
46 struct BrowserPluginHostMsg_CreateGuest_Params; 47 struct BrowserPluginHostMsg_CreateGuest_Params;
47 struct BrowserPluginHostMsg_ResizeGuest_Params; 48 struct BrowserPluginHostMsg_ResizeGuest_Params;
48 class TransportDIB; 49 class TransportDIB;
49 struct ViewHostMsg_UpdateRect_Params; 50 struct ViewHostMsg_UpdateRect_Params;
50 struct WebDropData; 51 struct WebDropData;
51 52
52 namespace WebKit { 53 namespace WebKit {
53 class WebInputEvent; 54 class WebInputEvent;
54 } 55 }
55 56
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // Handles drag events from the embedder. 172 // Handles drag events from the embedder.
172 // When dragging, the drag events go to the embedder first, and if the drag 173 // When dragging, the drag events go to the embedder first, and if the drag
173 // happens on the browser plugin, then the plugin sends a corresponding 174 // happens on the browser plugin, then the plugin sends a corresponding
174 // drag-message to the guest. This routes the drag-message to the guest 175 // drag-message to the guest. This routes the drag-message to the guest
175 // renderer. 176 // renderer.
176 void DragStatusUpdate(WebKit::WebDragStatus drag_status, 177 void DragStatusUpdate(WebKit::WebDragStatus drag_status,
177 const WebDropData& drop_data, 178 const WebDropData& drop_data,
178 WebKit::WebDragOperationsMask drag_mask, 179 WebKit::WebDragOperationsMask drag_mask,
179 const gfx::Point& location); 180 const gfx::Point& location);
180 181
182 // Updates the autosize state of the guest.
183 void SetAutoSize(
184 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params,
185 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params);
186
181 // Updates the cursor during dragging. 187 // Updates the cursor during dragging.
182 // During dragging, if the guest notifies to update the cursor for a drag, 188 // During dragging, if the guest notifies to update the cursor for a drag,
183 // then it is necessary to route the cursor update to the embedder correctly 189 // then it is necessary to route the cursor update to the embedder correctly
184 // so that the cursor updates properly. 190 // so that the cursor updates properly.
185 void UpdateDragCursor(WebKit::WebDragOperation operation); 191 void UpdateDragCursor(WebKit::WebDragOperation operation);
186 192
187 // Exposes the protected web_contents() from WebContentsObserver. 193 // Exposes the protected web_contents() from WebContentsObserver.
188 WebContents* GetWebContents(); 194 WebContents* GetWebContents();
189 195
190 // Kill the guest process. 196 // Kill the guest process.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 249
244 // Helper to send messages to embedder. Overridden in test implementation 250 // Helper to send messages to embedder. Overridden in test implementation
245 // since we want to intercept certain messages for testing. 251 // since we want to intercept certain messages for testing.
246 virtual void SendMessageToEmbedder(IPC::Message* msg); 252 virtual void SendMessageToEmbedder(IPC::Message* msg);
247 253
248 // Called when a redirect notification occurs. 254 // Called when a redirect notification occurs.
249 void LoadRedirect(const GURL& old_url, 255 void LoadRedirect(const GURL& old_url,
250 const GURL& new_url, 256 const GURL& new_url,
251 bool is_top_level); 257 bool is_top_level);
252 258
259 bool InAutoSizeBounds(const gfx::Size& size) const;
253 // Static factory instance (always NULL for non-test). 260 // Static factory instance (always NULL for non-test).
254 static content::BrowserPluginHostFactory* factory_; 261 static content::BrowserPluginHostFactory* factory_;
255 262
256 NotificationRegistrar notification_registrar_; 263 NotificationRegistrar notification_registrar_;
257 WebContentsImpl* embedder_web_contents_; 264 WebContentsImpl* embedder_web_contents_;
258 // An identifier that uniquely identifies a browser plugin guest within an 265 // An identifier that uniquely identifies a browser plugin guest within an
259 // embedder. 266 // embedder.
260 int instance_id_; 267 int instance_id_;
261 scoped_ptr<TransportDIB> damage_buffer_; 268 scoped_ptr<TransportDIB> damage_buffer_;
262 #if defined(OS_WIN) 269 #if defined(OS_WIN)
(...skipping 14 matching lines...) Expand all
277 int max_width_; 284 int max_width_;
278 int min_height_; 285 int min_height_;
279 int min_width_; 286 int min_width_;
280 287
281 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); 288 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest);
282 }; 289 };
283 290
284 } // namespace content 291 } // namespace content
285 292
286 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ 293 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698