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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // a popup (such as a <select> dropdown), then shows the popup at |pos|. | 251 // a popup (such as a <select> dropdown), then shows the popup at |pos|. |
252 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 252 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
253 const gfx::Rect& bounds) = 0; | 253 const gfx::Rect& bounds) = 0; |
254 | 254 |
255 // Perform all the initialization steps necessary for this object to represent | 255 // Perform all the initialization steps necessary for this object to represent |
256 // a full screen window. | 256 // a full screen window. |
257 // |reference_host_view| is the view associated with the creating page that | 257 // |reference_host_view| is the view associated with the creating page that |
258 // helps to position the full screen widget on the correct monitor. | 258 // helps to position the full screen widget on the correct monitor. |
259 virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0; | 259 virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0; |
260 | 260 |
261 // Moves all plugin windows as described in the given list. | |
262 // |scroll_offset| is the scroll offset of the render view. | |
263 virtual void MovePluginWindows( | |
264 const std::vector<WebPluginGeometry>& moves) = 0; | |
265 | |
266 // Sets the cursor to the one associated with the specified cursor_type | 261 // Sets the cursor to the one associated with the specified cursor_type |
267 virtual void UpdateCursor(const WebCursor& cursor) = 0; | 262 virtual void UpdateCursor(const WebCursor& cursor) = 0; |
268 | 263 |
269 // Indicates whether the page has finished loading. | 264 // Indicates whether the page has finished loading. |
270 virtual void SetIsLoading(bool is_loading) = 0; | 265 virtual void SetIsLoading(bool is_loading) = 0; |
271 | 266 |
272 // Updates the state of the input method attached to the view. | 267 // Updates the state of the input method attached to the view. |
273 virtual void TextInputStateChanged( | 268 virtual void TextInputStateChanged( |
274 const ViewHostMsg_TextInputState_Params& params) = 0; | 269 const ViewHostMsg_TextInputState_Params& params) = 0; |
275 | 270 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 const gfx::Range& range, | 378 const gfx::Range& range, |
384 const std::vector<gfx::Rect>& character_bounds) = 0; | 379 const std::vector<gfx::Rect>& character_bounds) = 0; |
385 | 380 |
386 #if defined(OS_WIN) | 381 #if defined(OS_WIN) |
387 virtual void SetParentNativeViewAccessible( | 382 virtual void SetParentNativeViewAccessible( |
388 gfx::NativeViewAccessible accessible_parent) = 0; | 383 gfx::NativeViewAccessible accessible_parent) = 0; |
389 | 384 |
390 // Returns an HWND that's given as the parent window for windowless Flash to | 385 // Returns an HWND that's given as the parent window for windowless Flash to |
391 // workaround crbug.com/301548. | 386 // workaround crbug.com/301548. |
392 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const = 0; | 387 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const = 0; |
393 | |
394 // The callback that DetachPluginsHelper calls for each child window. Call | |
395 // this directly if you want to do custom filtering on plugin windows first. | |
396 static void DetachPluginWindowsCallback(HWND window); | |
397 #endif | 388 #endif |
398 | 389 |
399 // Add and remove observers for lifetime event notifications. The order in | 390 // Add and remove observers for lifetime event notifications. The order in |
400 // which notifications are sent to observers is undefined. Clients must be | 391 // which notifications are sent to observers is undefined. Clients must be |
401 // sure to remove the observer before they go away. | 392 // sure to remove the observer before they go away. |
402 void AddObserver(RenderWidgetHostViewBaseObserver* observer); | 393 void AddObserver(RenderWidgetHostViewBaseObserver* observer); |
403 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); | 394 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); |
404 | 395 |
405 // Exposed for testing. | 396 // Exposed for testing. |
406 virtual cc::SurfaceId SurfaceIdForTesting() const; | 397 virtual cc::SurfaceId SurfaceIdForTesting() const; |
407 | 398 |
408 protected: | 399 protected: |
409 // Interface class only, do not construct. | 400 // Interface class only, do not construct. |
410 RenderWidgetHostViewBase(); | 401 RenderWidgetHostViewBase(); |
411 | 402 |
412 void NotifyObserversAboutShutdown(); | 403 void NotifyObserversAboutShutdown(); |
413 | 404 |
414 #if defined(OS_WIN) | |
415 // Shared implementation of MovePluginWindows for use by win and aura/wina. | |
416 static void MovePluginWindowsHelper( | |
417 HWND parent, | |
418 const std::vector<WebPluginGeometry>& moves); | |
419 | |
420 static void PaintPluginWindowsHelper( | |
421 HWND parent, | |
422 const gfx::Rect& damaged_screen_rect); | |
423 | |
424 // Needs to be called before the HWND backing the view goes away to avoid | |
425 // crashes in Windowed plugins. | |
426 static void DetachPluginsHelper(HWND parent); | |
427 #endif | |
428 | |
429 // Whether this view is a popup and what kind of popup it is (select, | 405 // Whether this view is a popup and what kind of popup it is (select, |
430 // autofill...). | 406 // autofill...). |
431 blink::WebPopupType popup_type_; | 407 blink::WebPopupType popup_type_; |
432 | 408 |
433 // The background color of the web content. | 409 // The background color of the web content. |
434 SkColor background_color_; | 410 SkColor background_color_; |
435 | 411 |
436 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 412 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
437 // are still generated. However, the position they report is the last known | 413 // are still generated. However, the position they report is the last known |
438 // mouse position just as mouse lock was entered; the movement they report | 414 // mouse position just as mouse lock was entered; the movement they report |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 452 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
477 | 453 |
478 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 454 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
479 | 455 |
480 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 456 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
481 }; | 457 }; |
482 | 458 |
483 } // namespace content | 459 } // namespace content |
484 | 460 |
485 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 461 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |