| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 namespace ui { | 61 namespace ui { |
| 62 class LatencyInfo; | 62 class LatencyInfo; |
| 63 } | 63 } |
| 64 | 64 |
| 65 namespace content { | 65 namespace content { |
| 66 class BrowserAccessibilityDelegate; | 66 class BrowserAccessibilityDelegate; |
| 67 class BrowserAccessibilityManager; | 67 class BrowserAccessibilityManager; |
| 68 class RenderWidgetHostViewBaseObserver; | 68 class RenderWidgetHostViewBaseObserver; |
| 69 class SyntheticGesture; | 69 class SyntheticGesture; |
| 70 class SyntheticGestureTarget; | 70 class SyntheticGestureTarget; |
| 71 class RenderWidgetHostImpl; |
| 71 class TextInputManager; | 72 class TextInputManager; |
| 72 class WebCursor; | 73 class WebCursor; |
| 73 struct DidOverscrollParams; | 74 struct DidOverscrollParams; |
| 74 struct NativeWebKeyboardEvent; | 75 struct NativeWebKeyboardEvent; |
| 75 struct TextInputState; | 76 struct TextInputState; |
| 76 | 77 |
| 77 // Basic implementation shared by concrete RenderWidgetHostView subclasses. | 78 // Basic implementation shared by concrete RenderWidgetHostView subclasses. |
| 78 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, | 79 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| 79 public IPC::Listener { | 80 public IPC::Listener { |
| 80 public: | 81 public: |
| 81 ~RenderWidgetHostViewBase() override; | 82 ~RenderWidgetHostViewBase() override; |
| 82 | 83 |
| 83 float current_device_scale_factor() const { | 84 float current_device_scale_factor() const { |
| 84 return current_device_scale_factor_; | 85 return current_device_scale_factor_; |
| 85 } | 86 } |
| 86 | 87 |
| 88 // Returns the focused RenderWidgetHost inside this |view|'s RWH. |
| 89 RenderWidgetHostImpl* GetFocusedWidget() const; |
| 90 |
| 87 // RenderWidgetHostView implementation. | 91 // RenderWidgetHostView implementation. |
| 92 RenderWidgetHost* GetRenderWidgetHost() const override; |
| 88 void SetBackgroundColor(SkColor color) override; | 93 void SetBackgroundColor(SkColor color) override; |
| 89 void SetBackgroundColorToDefault() final; | 94 void SetBackgroundColorToDefault() final; |
| 90 bool GetBackgroundOpaque() override; | 95 bool GetBackgroundOpaque() override; |
| 91 ui::TextInputClient* GetTextInputClient() override; | 96 ui::TextInputClient* GetTextInputClient() override; |
| 92 void WasUnOccluded() override {} | 97 void WasUnOccluded() override {} |
| 93 void WasOccluded() override {} | 98 void WasOccluded() override {} |
| 94 bool IsShowingContextMenu() const override; | 99 bool IsShowingContextMenu() const override; |
| 95 void SetShowingContextMenu(bool showing_menu) override; | 100 void SetShowingContextMenu(bool showing_menu) override; |
| 96 base::string16 GetSelectedText() override; | 101 base::string16 GetSelectedText() override; |
| 97 bool IsMouseLocked() override; | 102 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_| | 409 // 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 | 410 // 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 | 411 // TextInputManager if it is destroyed or if the TextInputManager itself is |
| 407 // destroyed. The unregistration of the RWHV from TextInputManager is | 412 // destroyed. The unregistration of the RWHV from TextInputManager is |
| 408 // necessary and must be done by explicitly calling | 413 // necessary and must be done by explicitly calling |
| 409 // TextInputManager::Unregister. | 414 // TextInputManager::Unregister. |
| 410 // It is safer to use this method rather than directly dereferencing | 415 // It is safer to use this method rather than directly dereferencing |
| 411 // |text_input_manager_|. | 416 // |text_input_manager_|. |
| 412 TextInputManager* GetTextInputManager(); | 417 TextInputManager* GetTextInputManager(); |
| 413 | 418 |
| 419 // Returns the the view which has a RWH and is currently accepting input |
| 420 // events (focused). |
| 421 RenderWidgetHostViewBase* GetFocusedAttachedSubView() const; |
| 422 |
| 414 // Whether this view is a popup and what kind of popup it is (select, | 423 // Whether this view is a popup and what kind of popup it is (select, |
| 415 // autofill...). | 424 // autofill...). |
| 416 blink::WebPopupType popup_type_; | 425 blink::WebPopupType popup_type_; |
| 417 | 426 |
| 418 // The background color of the web content. | 427 // The background color of the web content. |
| 419 SkColor background_color_; | 428 SkColor background_color_; |
| 420 | 429 |
| 421 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 430 // 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 | 431 // 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 | 432 // 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_; | 481 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
| 473 | 482 |
| 474 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 483 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 475 | 484 |
| 476 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 485 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 477 }; | 486 }; |
| 478 | 487 |
| 479 } // namespace content | 488 } // namespace content |
| 480 | 489 |
| 481 #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 |