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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
7 | 7 |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 RenderViewImpl* render_view, | 196 RenderViewImpl* render_view, |
197 WebKit::WebFrame* frame, | 197 WebKit::WebFrame* frame, |
198 const WebKit::WebPluginParams& params); | 198 const WebKit::WebPluginParams& params); |
199 | 199 |
200 virtual ~BrowserPlugin(); | 200 virtual ~BrowserPlugin(); |
201 | 201 |
202 int width() const { return plugin_rect_.width(); } | 202 int width() const { return plugin_rect_.width(); } |
203 int height() const { return plugin_rect_.height(); } | 203 int height() const { return plugin_rect_.height(); } |
204 int instance_id() const { return instance_id_; } | 204 int instance_id() const { return instance_id_; } |
205 int render_view_routing_id() const { return render_view_routing_id_; } | 205 int render_view_routing_id() const { return render_view_routing_id_; } |
| 206 BrowserPluginManager* browser_plugin_manager() const { |
| 207 return browser_plugin_manager_; |
| 208 } |
206 | 209 |
207 // Virtual to allow for mocking in tests. | 210 // Virtual to allow for mocking in tests. |
208 virtual float GetDeviceScaleFactor() const; | 211 virtual float GetDeviceScaleFactor() const; |
209 | 212 |
210 // Parses the attributes of the browser plugin from the element's attributes | 213 // Parses the attributes of the browser plugin from the element's attributes |
211 // and sets them appropriately. | 214 // and sets them appropriately. |
212 void ParseAttributes(const WebKit::WebPluginParams& params); | 215 void ParseAttributes(const WebKit::WebPluginParams& params); |
213 | 216 |
214 // Returns the pending resize guest param if there is one. Returns a param | 217 // Returns the pending resize guest param if there is one. Returns a param |
215 // with invalid transport dib otherwise. | 218 // with invalid transport dib otherwise. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 bool embedder_focused_; | 286 bool embedder_focused_; |
284 // Tracks the visibility of the browser plugin regardless of the whole | 287 // Tracks the visibility of the browser plugin regardless of the whole |
285 // embedder RenderView's visibility. | 288 // embedder RenderView's visibility. |
286 bool visible_; | 289 bool visible_; |
287 | 290 |
288 WebCursor cursor_; | 291 WebCursor cursor_; |
289 | 292 |
290 gfx::Size last_view_size_; | 293 gfx::Size last_view_size_; |
291 bool size_changed_in_flight_; | 294 bool size_changed_in_flight_; |
292 | 295 |
| 296 // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to |
| 297 // store the BrowserPlugin's BrowserPluginManager in a member variable to |
| 298 // avoid accessing the RenderViewImpl. |
| 299 scoped_refptr<BrowserPluginManager> browser_plugin_manager_; |
| 300 |
293 // Important: Do not add more history state here. | 301 // Important: Do not add more history state here. |
294 // We strongly discourage storing additional history state (such as page IDs) | 302 // We strongly discourage storing additional history state (such as page IDs) |
295 // in the embedder process, at the risk of having incorrect information that | 303 // in the embedder process, at the risk of having incorrect information that |
296 // can lead to broken back/forward logic in apps. | 304 // can lead to broken back/forward logic in apps. |
297 // It's also important that this state does not get modified by any logic in | 305 // It's also important that this state does not get modified by any logic in |
298 // the embedder process. It should only be updated in response to navigation | 306 // the embedder process. It should only be updated in response to navigation |
299 // events in the guest. No assumptions should be made about how the index | 307 // events in the guest. No assumptions should be made about how the index |
300 // will change after a navigation (e.g., for back, forward, or go), because | 308 // will change after a navigation (e.g., for back, forward, or go), because |
301 // the changes are not always obvious. For example, there is a maximum | 309 // the changes are not always obvious. For example, there is a maximum |
302 // number of entries and earlier ones will automatically be pruned. | 310 // number of entries and earlier ones will automatically be pruned. |
303 int current_nav_entry_index_; | 311 int current_nav_entry_index_; |
304 int nav_entry_count_; | 312 int nav_entry_count_; |
305 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 313 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
306 }; | 314 }; |
307 | 315 |
308 } // namespace content | 316 } // namespace content |
309 | 317 |
310 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 318 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |