| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Basic implementation shared by concrete RenderWidgetHostView subclasses. | 77 // Basic implementation shared by concrete RenderWidgetHostView subclasses. |
| 78 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, | 78 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| 79 public IPC::Listener { | 79 public IPC::Listener { |
| 80 public: | 80 public: |
| 81 ~RenderWidgetHostViewBase() override; | 81 ~RenderWidgetHostViewBase() override; |
| 82 | 82 |
| 83 float current_device_scale_factor() const { | 83 float current_device_scale_factor() const { |
| 84 return current_device_scale_factor_; | 84 return current_device_scale_factor_; |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Returns the view which is inside |view| and is currently focused (i.e., |
| 88 // accepts input events). It might return nullptr if |view| does not have a |
| 89 // RenderWidgetHost or the focused widget returned by RenderWidgetHostDelegate |
| 90 // for the |view|'s RWH is nullptr. |
| 91 static RenderWidgetHostViewBase* GetFocusedSubView( |
| 92 RenderWidgetHostViewBase* view); |
| 93 |
| 87 // RenderWidgetHostView implementation. | 94 // RenderWidgetHostView implementation. |
| 95 RenderWidgetHost* GetRenderWidgetHost() const override; |
| 88 void SetBackgroundColor(SkColor color) override; | 96 void SetBackgroundColor(SkColor color) override; |
| 89 void SetBackgroundColorToDefault() final; | 97 void SetBackgroundColorToDefault() final; |
| 90 bool GetBackgroundOpaque() override; | 98 bool GetBackgroundOpaque() override; |
| 91 ui::TextInputClient* GetTextInputClient() override; | 99 ui::TextInputClient* GetTextInputClient() override; |
| 92 void WasUnOccluded() override {} | 100 void WasUnOccluded() override {} |
| 93 void WasOccluded() override {} | 101 void WasOccluded() override {} |
| 94 bool IsShowingContextMenu() const override; | 102 bool IsShowingContextMenu() const override; |
| 95 void SetShowingContextMenu(bool showing_menu) override; | 103 void SetShowingContextMenu(bool showing_menu) override; |
| 96 base::string16 GetSelectedText() override; | 104 base::string16 GetSelectedText() override; |
| 97 bool IsMouseLocked() override; | 105 bool IsMouseLocked() override; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 // null reference is obtained, its value is cached in |text_input_manager_| | 412 // null reference is obtained, its value is cached in |text_input_manager_| |
| 405 // and this view is registered with it. The RWHV will unregister from the | 413 // and this view is registered with it. The RWHV will unregister from the |
| 406 // TextInputManager if it is destroyed or if the TextInputManager itself is | 414 // TextInputManager if it is destroyed or if the TextInputManager itself is |
| 407 // destroyed. The unregistration of the RWHV from TextInputManager is | 415 // destroyed. The unregistration of the RWHV from TextInputManager is |
| 408 // necessary and must be done by explicitly calling | 416 // necessary and must be done by explicitly calling |
| 409 // TextInputManager::Unregister. | 417 // TextInputManager::Unregister. |
| 410 // It is safer to use this method rather than directly dereferencing | 418 // It is safer to use this method rather than directly dereferencing |
| 411 // |text_input_manager_|. | 419 // |text_input_manager_|. |
| 412 TextInputManager* GetTextInputManager(); | 420 TextInputManager* GetTextInputManager(); |
| 413 | 421 |
| 422 // Returns the the view which has a RWH and is currently accepting input |
| 423 // events (focused). |
| 424 RenderWidgetHostViewBase* GetFocusedAttachedSubView() const; |
| 425 |
| 414 // Whether this view is a popup and what kind of popup it is (select, | 426 // Whether this view is a popup and what kind of popup it is (select, |
| 415 // autofill...). | 427 // autofill...). |
| 416 blink::WebPopupType popup_type_; | 428 blink::WebPopupType popup_type_; |
| 417 | 429 |
| 418 // The background color of the web content. | 430 // The background color of the web content. |
| 419 SkColor background_color_; | 431 SkColor background_color_; |
| 420 | 432 |
| 421 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 433 // While the mouse is locked, the cursor is hidden from the user. Mouse events |
| 422 // are still generated. However, the position they report is the last known | 434 // are still generated. However, the position they report is the last known |
| 423 // mouse position just as mouse lock was entered; the movement they report | 435 // mouse position just as mouse lock was entered; the movement they report |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 484 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
| 473 | 485 |
| 474 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 486 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 475 | 487 |
| 476 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 488 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 477 }; | 489 }; |
| 478 | 490 |
| 479 } // namespace content | 491 } // namespace content |
| 480 | 492 |
| 481 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 493 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| OLD | NEW |