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

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

Issue 10965048: [BrowserTag] Send dib info with NavigateGuest message, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unit test now checks for damage_buffer to be of correct size. Created 8 years, 2 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 | 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 BrowserPluginEmbedder has a list of guests it manages. 5 // A BrowserPluginEmbedder has a list of guests it manages.
6 // In the beginning when a renderer sees one or more guests (BrowserPlugin 6 // In the beginning when a renderer sees one or more guests (BrowserPlugin
7 // instance(s)) and there is a request to navigate to them, the WebContents for 7 // instance(s)) and there is a request to navigate to them, the WebContents for
8 // that renderer creates a BrowserPluginEmbedder for itself. The 8 // that renderer creates a BrowserPluginEmbedder for itself. The
9 // BrowserPluginEmbedder, in turn, manages a set of BrowserPluginGuests -- one 9 // BrowserPluginEmbedder, in turn, manages a set of BrowserPluginGuests -- one
10 // BrowserPluginGuest for each guest in the embedding WebContents. Note that 10 // BrowserPluginGuest for each guest in the embedding WebContents. Note that
(...skipping 11 matching lines...) Expand all
22 22
23 #include <map> 23 #include <map>
24 24
25 #include "base/compiler_specific.h" 25 #include "base/compiler_specific.h"
26 #include "content/public/browser/notification_observer.h" 26 #include "content/public/browser/notification_observer.h"
27 #include "content/public/browser/notification_registrar.h" 27 #include "content/public/browser/notification_registrar.h"
28 #include "content/public/browser/web_contents_observer.h" 28 #include "content/public/browser/web_contents_observer.h"
29 29
30 class TransportDIB; 30 class TransportDIB;
31 class WebContentsImpl; 31 class WebContentsImpl;
32 struct BrowserPluginHostMsg_ResizeGuest_Params;
32 33
33 namespace WebKit { 34 namespace WebKit {
34 class WebInputEvent; 35 class WebInputEvent;
35 } 36 }
36 37
37 namespace gfx { 38 namespace gfx {
38 class Rect; 39 class Rect;
39 class Size; 40 class Size;
40 } 41 }
41 42
(...skipping 13 matching lines...) Expand all
55 public NotificationObserver { 56 public NotificationObserver {
56 public: 57 public:
57 typedef std::map<int, WebContents*> ContainerInstanceMap; 58 typedef std::map<int, WebContents*> ContainerInstanceMap;
58 59
59 virtual ~BrowserPluginEmbedder(); 60 virtual ~BrowserPluginEmbedder();
60 61
61 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents, 62 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents,
62 RenderViewHost* render_view_host); 63 RenderViewHost* render_view_host);
63 64
64 // Navigates in a guest (new or existing). 65 // Navigates in a guest (new or existing).
65 void NavigateGuest(RenderViewHost* render_view_host, 66 void NavigateGuest(
66 int instance_id, 67 RenderViewHost* render_view_host,
67 int64 frame_id, 68 int instance_id,
68 const std::string& src, 69 int64 frame_id,
69 const gfx::Size& size); 70 const std::string& src,
71 const BrowserPluginHostMsg_ResizeGuest_Params& resize_params);
72
73 void ResizeGuest(int instance_id,
74 const BrowserPluginHostMsg_ResizeGuest_Params& params);
75
70 void Stop(int instance_id); 76 void Stop(int instance_id);
71 void Reload(int instance_id); 77 void Reload(int instance_id);
72 78
73 // WebContentsObserver implementation. 79 // WebContentsObserver implementation.
74 virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; 80 virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE;
75 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; 81 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
76 82
77 // NotificationObserver method override. 83 // NotificationObserver method override.
78 virtual void Observe(int type, 84 virtual void Observe(int type,
79 const NotificationSource& source, 85 const NotificationSource& source,
80 const NotificationDetails& details) OVERRIDE; 86 const NotificationDetails& details) OVERRIDE;
81 87
82 // Message handlers (direct/indirect via BrowserPluginEmbedderHelper). 88 // Message handlers (direct/indirect via BrowserPluginEmbedderHelper).
83 // Routes update rect ack message to the appropriate guest. 89 // Routes update rect ack message to the appropriate guest.
84 void UpdateRectACK(int instance_id, int message_id, const gfx::Size& size); 90 void UpdateRectACK(int instance_id, int message_id, const gfx::Size& size);
85 void SetFocus(int instance_id, bool focused); 91 void SetFocus(int instance_id, bool focused);
86 void ResizeGuest(int instance_id,
87 TransportDIB* damage_buffer,
88 #if defined(OS_WIN)
89 int damage_buffer_size,
90 #endif
91 int width,
92 int height,
93 bool resize_pending,
94 float scale_factor);
95 // Handles input events sent from the BrowserPlugin (embedder's renderer 92 // Handles input events sent from the BrowserPlugin (embedder's renderer
96 // process) by passing them to appropriate guest's input handler. 93 // process) by passing them to appropriate guest's input handler.
97 void HandleInputEvent(int instance_id, 94 void HandleInputEvent(int instance_id,
98 RenderViewHost* render_view_host, 95 RenderViewHost* render_view_host,
99 const gfx::Rect& guest_rect, 96 const gfx::Rect& guest_rect,
100 const WebKit::WebInputEvent& event, 97 const WebKit::WebInputEvent& event,
101 IPC::Message* reply_message); 98 IPC::Message* reply_message);
102 void PluginDestroyed(int instance_id); 99 void PluginDestroyed(int instance_id);
103 100
104 // Overrides factory for testing. Default (NULL) value indicates regular 101 // Overrides factory for testing. Default (NULL) value indicates regular
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Contains guests' WebContents, mapping from their instance ids. 133 // Contains guests' WebContents, mapping from their instance ids.
137 ContainerInstanceMap guest_web_contents_by_instance_id_; 134 ContainerInstanceMap guest_web_contents_by_instance_id_;
138 RenderViewHost* render_view_host_; 135 RenderViewHost* render_view_host_;
139 136
140 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); 137 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder);
141 }; 138 };
142 139
143 } // namespace content 140 } // namespace content
144 141
145 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ 142 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698