Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_base.h

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: add missing files Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 struct NativeWebKeyboardEvent; 73 struct NativeWebKeyboardEvent;
74 struct TextInputState; 74 struct TextInputState;
75 75
76 // Basic implementation shared by concrete RenderWidgetHostView subclasses. 76 // Basic implementation shared by concrete RenderWidgetHostView subclasses.
77 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, 77 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
78 public IPC::Listener { 78 public IPC::Listener {
79 public: 79 public:
80 ~RenderWidgetHostViewBase() override; 80 ~RenderWidgetHostViewBase() override;
81 81
82 float current_device_scale_factor() const { 82 float current_device_scale_factor() const {
83 return current_device_scale_factor_; 83 return current_device_scale_factor_;
tapted 2017/02/15 00:36:10 Can any callers just use this instead? (i.e. rath
Jinsuk Kim 2017/02/16 10:11:25 Replaced this with virtual GetScaleFactorForNative
84 } 84 }
85 85
86 // Returns the focused RenderWidgetHost inside this |view|'s RWH. 86 // Returns the focused RenderWidgetHost inside this |view|'s RWH.
87 RenderWidgetHostImpl* GetFocusedWidget() const; 87 RenderWidgetHostImpl* GetFocusedWidget() const;
88 88
89 // RenderWidgetHostView implementation. 89 // RenderWidgetHostView implementation.
90 RenderWidgetHost* GetRenderWidgetHost() const override; 90 RenderWidgetHost* GetRenderWidgetHost() const override;
91 void SetBackgroundColor(SkColor color) override; 91 void SetBackgroundColor(SkColor color) override;
92 SkColor background_color() override; 92 SkColor background_color() override;
93 void SetBackgroundColorToDefault() final; 93 void SetBackgroundColorToDefault() final;
94 bool GetBackgroundOpaque() override; 94 bool GetBackgroundOpaque() override;
95 ui::TextInputClient* GetTextInputClient() override; 95 ui::TextInputClient* GetTextInputClient() override;
96 void WasUnOccluded() override {} 96 void WasUnOccluded() override {}
97 void WasOccluded() override {} 97 void WasOccluded() override {}
98 bool IsShowingContextMenu() const override; 98 bool IsShowingContextMenu() const override;
99 void SetShowingContextMenu(bool showing_menu) override; 99 void SetShowingContextMenu(bool showing_menu) override;
100 void SetIsInVR(bool is_in_vr) override; 100 void SetIsInVR(bool is_in_vr) override;
101 base::string16 GetSelectedText() override; 101 base::string16 GetSelectedText() override;
102 bool IsMouseLocked() override; 102 bool IsMouseLocked() override;
103 gfx::Size GetVisibleViewportSize() const override; 103 gfx::Size GetVisibleViewportSize() const override;
104 void SetInsets(const gfx::Insets& insets) override; 104 void SetInsets(const gfx::Insets& insets) override;
105 void BeginFrameSubscription( 105 void BeginFrameSubscription(
106 std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override; 106 std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override;
107 void EndFrameSubscription() override; 107 void EndFrameSubscription() override;
108 void FocusedNodeTouched(const gfx::Point& location_dips_screen, 108 void FocusedNodeTouched(const gfx::Point& location_dips_screen,
109 bool editable) override; 109 bool editable) override;
110 float GetScaleFactorForNativeView() const override;
110 111
111 // This only needs to be overridden by RenderWidgetHostViewBase subclasses 112 // This only needs to be overridden by RenderWidgetHostViewBase subclasses
112 // that handle content embedded within other RenderWidgetHostViews. 113 // that handle content embedded within other RenderWidgetHostViews.
113 gfx::Point TransformPointToRootCoordSpace(const gfx::Point& point) override; 114 gfx::Point TransformPointToRootCoordSpace(const gfx::Point& point) override;
114 gfx::PointF TransformPointToRootCoordSpaceF( 115 gfx::PointF TransformPointToRootCoordSpaceF(
115 const gfx::PointF& point) override; 116 const gfx::PointF& point) override;
116 117
117 // IPC::Listener implementation: 118 // IPC::Listener implementation:
118 bool OnMessageReceived(const IPC::Message& msg) override; 119 bool OnMessageReceived(const IPC::Message& msg) override;
119 120
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; 484 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_;
484 485
485 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; 486 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
486 487
487 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); 488 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);
488 }; 489 };
489 490
490 } // namespace content 491 } // namespace content
491 492
492 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ 493 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698