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

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

Issue 11066032: Browser Plugin: Update Guest WebContents Visibility on BrowserPlugin Visiblity Change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test 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 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 void set_guest_hang_timeout_for_testing(const base::TimeDelta& timeout) { 75 void set_guest_hang_timeout_for_testing(const base::TimeDelta& timeout) {
76 guest_hang_timeout_ = timeout; 76 guest_hang_timeout_ = timeout;
77 } 77 }
78 78
79 void set_embedder_render_process_host( 79 void set_embedder_render_process_host(
80 RenderProcessHost* render_process_host) { 80 RenderProcessHost* render_process_host) {
81 embedder_render_process_host_ = render_process_host; 81 embedder_render_process_host_ = render_process_host;
82 } 82 }
83 83
84 bool visible() const { return visible_; }
85
84 // WebContentsObserver implementation. 86 // WebContentsObserver implementation.
85 virtual void DidStartProvisionalLoadForFrame( 87 virtual void DidStartProvisionalLoadForFrame(
86 int64 frame_id, 88 int64 frame_id,
87 bool is_main_frame, 89 bool is_main_frame,
88 const GURL& validated_url, 90 const GURL& validated_url,
89 bool is_error_page, 91 bool is_error_page,
90 RenderViewHost* render_view_host) OVERRIDE; 92 RenderViewHost* render_view_host) OVERRIDE;
91 virtual void DidFailProvisionalLoad( 93 virtual void DidFailProvisionalLoad(
92 int64 frame_id, 94 int64 frame_id,
93 bool is_main_frame, 95 bool is_main_frame,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const gfx::Rect& initial_pos); 127 const gfx::Rect& initial_pos);
126 void SetCursor(const WebCursor& cursor); 128 void SetCursor(const WebCursor& cursor);
127 // Handles input event acks so they are sent to browser plugin host (via 129 // Handles input event acks so they are sent to browser plugin host (via
128 // embedder) instead of default view/widget host. 130 // embedder) instead of default view/widget host.
129 void HandleInputEventAck(RenderViewHost* render_view_host, bool handled); 131 void HandleInputEventAck(RenderViewHost* render_view_host, bool handled);
130 132
131 // The guest needs to notify the plugin in the embedder to start (or stop) 133 // The guest needs to notify the plugin in the embedder to start (or stop)
132 // accepting touch events. 134 // accepting touch events.
133 void SetIsAcceptingTouchEvents(bool accept); 135 void SetIsAcceptingTouchEvents(bool accept);
134 136
137 void SetVisibility(bool embedder_visible, bool visible);
Charlie Reis 2012/10/05 00:33:18 nit: Add a comment.
Fady Samuel 2012/10/05 15:22:07 Done.
138
135 // Exposes the protected web_contents() from WebContentsObserver. 139 // Exposes the protected web_contents() from WebContentsObserver.
136 WebContents* GetWebContents(); 140 WebContents* GetWebContents();
137 141
138 // Kill the guest process. 142 // Kill the guest process.
139 void Terminate(); 143 void Terminate();
140 144
141 // Overridden in tests. 145 // Overridden in tests.
142 virtual bool ViewTakeFocus(bool reverse); 146 virtual bool ViewTakeFocus(bool reverse);
143 // If possible, navigate the guest to |relative_index| entries away from the 147 // If possible, navigate the guest to |relative_index| entries away from the
144 // current navigation entry. 148 // current navigation entry.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 size_t damage_buffer_size_; 196 size_t damage_buffer_size_;
193 #endif 197 #endif
194 gfx::Size damage_view_size_; 198 gfx::Size damage_view_size_;
195 float damage_buffer_scale_factor_; 199 float damage_buffer_scale_factor_;
196 scoped_ptr<IPC::Message> pending_input_event_reply_; 200 scoped_ptr<IPC::Message> pending_input_event_reply_;
197 gfx::Rect guest_rect_; 201 gfx::Rect guest_rect_;
198 WebCursor cursor_; 202 WebCursor cursor_;
199 IDMap<RenderViewHost> pending_updates_; 203 IDMap<RenderViewHost> pending_updates_;
200 int pending_update_counter_; 204 int pending_update_counter_;
201 base::TimeDelta guest_hang_timeout_; 205 base::TimeDelta guest_hang_timeout_;
206 bool visible_;
202 207
203 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); 208 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest);
204 }; 209 };
205 210
206 } // namespace content 211 } // namespace content
207 212
208 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ 213 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698