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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 // Instructs the view to not drop the surface even when the view is hidden. | 390 // Instructs the view to not drop the surface even when the view is hidden. |
391 virtual void LockCompositingSurface() = 0; | 391 virtual void LockCompositingSurface() = 0; |
392 virtual void UnlockCompositingSurface() = 0; | 392 virtual void UnlockCompositingSurface() = 0; |
393 | 393 |
394 // Add and remove observers for lifetime event notifications. The order in | 394 // Add and remove observers for lifetime event notifications. The order in |
395 // which notifications are sent to observers is undefined. Clients must be | 395 // which notifications are sent to observers is undefined. Clients must be |
396 // sure to remove the observer before they go away. | 396 // sure to remove the observer before they go away. |
397 void AddObserver(RenderWidgetHostViewBaseObserver* observer); | 397 void AddObserver(RenderWidgetHostViewBaseObserver* observer); |
398 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); | 398 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); |
399 | 399 |
400 // Exposed for testing. | |
401 virtual bool IsChildFrameForTesting() const; | |
402 virtual cc::SurfaceId SurfaceIdForTesting() const; | |
403 | |
404 protected: | |
405 // Interface class only, do not construct. | |
406 RenderWidgetHostViewBase(); | |
407 | |
408 void NotifyObserversAboutShutdown(); | |
409 | |
410 // Returns a reference to the current instance of TextInputManager. The | 400 // Returns a reference to the current instance of TextInputManager. The |
411 // reference is obtained from RenderWidgetHostDelegate. The first time a non- | 401 // reference is obtained from RenderWidgetHostDelegate. The first time a non- |
412 // null reference is obtained, its value is cached in |text_input_manager_| | 402 // null reference is obtained, its value is cached in |text_input_manager_| |
413 // and this view is registered with it. The RWHV will unregister from the | 403 // and this view is registered with it. The RWHV will unregister from the |
414 // TextInputManager if it is destroyed or if the TextInputManager itself is | 404 // TextInputManager if it is destroyed or if the TextInputManager itself is |
415 // destroyed. The unregistration of the RWHV from TextInputManager is | 405 // destroyed. The unregistration of the RWHV from TextInputManager is |
416 // necessary and must be done by explicitly calling | 406 // necessary and must be done by explicitly calling |
417 // TextInputManager::Unregister. | 407 // TextInputManager::Unregister. |
418 // It is safer to use this method rather than directly dereferencing | 408 // It is safer to use this method rather than directly dereferencing |
419 // |text_input_manager_|. | 409 // |text_input_manager_|. |
420 TextInputManager* GetTextInputManager(); | 410 TextInputManager* GetTextInputManager(); |
421 | 411 |
412 bool is_fullscreen() { return is_fullscreen_; } | |
413 | |
414 // Exposed for testing. | |
415 virtual bool IsChildFrameForTesting() const; | |
416 virtual cc::SurfaceId SurfaceIdForTesting() const; | |
417 | |
418 protected: | |
419 // Interface class only, do not construct. | |
420 RenderWidgetHostViewBase(); | |
421 | |
422 void NotifyObserversAboutShutdown(); | |
423 | |
424 // Is this a fullscreen view? | |
425 bool is_fullscreen_; | |
tdresser
2016/09/23 13:54:09
Why did is_fullscreen move here? (Not looking for
jonross
2016/10/05 15:37:57
The concept of a RWHVB being fullscreen was alread
| |
426 | |
422 // Whether this view is a popup and what kind of popup it is (select, | 427 // Whether this view is a popup and what kind of popup it is (select, |
423 // autofill...). | 428 // autofill...). |
424 blink::WebPopupType popup_type_; | 429 blink::WebPopupType popup_type_; |
425 | 430 |
426 // The background color of the web content. | 431 // The background color of the web content. |
427 SkColor background_color_; | 432 SkColor background_color_; |
428 | 433 |
429 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 434 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
430 // are still generated. However, the position they report is the last known | 435 // are still generated. However, the position they report is the last known |
431 // mouse position just as mouse lock was entered; the movement they report | 436 // mouse position just as mouse lock was entered; the movement they report |
(...skipping 19 matching lines...) Expand all Loading... | |
451 // The current selection range relative to the start of the web page. | 456 // The current selection range relative to the start of the web page. |
452 gfx::Range selection_range_; | 457 gfx::Range selection_range_; |
453 #endif | 458 #endif |
454 | 459 |
455 // The scale factor of the display the renderer is currently on. | 460 // The scale factor of the display the renderer is currently on. |
456 float current_device_scale_factor_; | 461 float current_device_scale_factor_; |
457 | 462 |
458 // The orientation of the display the renderer is currently on. | 463 // The orientation of the display the renderer is currently on. |
459 display::Display::Rotation current_display_rotation_; | 464 display::Display::Rotation current_display_rotation_; |
460 | 465 |
461 // Whether pinch-to-zoom should be enabled and pinch events forwarded to the | |
462 // renderer. | |
463 bool pinch_zoom_enabled_; | |
464 | |
465 // A reference to current TextInputManager instance this RWHV is registered | 466 // A reference to current TextInputManager instance this RWHV is registered |
466 // with. This is initially nullptr until the first time the view calls | 467 // with. This is initially nullptr until the first time the view calls |
467 // GetTextInputManager(). It also becomes nullptr when TextInputManager is | 468 // GetTextInputManager(). It also becomes nullptr when TextInputManager is |
468 // destroyed before the RWHV is destroyed. | 469 // destroyed before the RWHV is destroyed. |
469 TextInputManager* text_input_manager_; | 470 TextInputManager* text_input_manager_; |
470 | 471 |
471 private: | 472 private: |
472 void FlushInput(); | 473 void FlushInput(); |
473 | 474 |
474 gfx::Rect current_display_area_; | 475 gfx::Rect current_display_area_; |
475 | 476 |
476 uint32_t renderer_frame_number_; | 477 uint32_t renderer_frame_number_; |
477 | 478 |
478 base::OneShotTimer flush_input_timer_; | 479 base::OneShotTimer flush_input_timer_; |
479 | 480 |
480 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 481 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
481 | 482 |
482 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 483 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
483 | 484 |
484 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 485 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
485 }; | 486 }; |
486 | 487 |
487 } // namespace content | 488 } // namespace content |
488 | 489 |
489 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 490 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |