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

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

Issue 2370393002: Extracting placeholder information from Webkit to Blimp (Closed)
Patch Set: Addressed some comments Created 4 years, 1 month 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 namespace content { 66 namespace content {
67 class BrowserAccessibilityDelegate; 67 class BrowserAccessibilityDelegate;
68 class BrowserAccessibilityManager; 68 class BrowserAccessibilityManager;
69 class RenderWidgetHostImpl; 69 class RenderWidgetHostImpl;
70 class RenderWidgetHostViewBaseObserver; 70 class RenderWidgetHostViewBaseObserver;
71 class SyntheticGesture; 71 class SyntheticGesture;
72 class SyntheticGestureTarget; 72 class SyntheticGestureTarget;
73 class TextInputManager; 73 class TextInputManager;
74 class WebCursor; 74 class WebCursor;
75 struct FormFieldData;
75 struct NativeWebKeyboardEvent; 76 struct NativeWebKeyboardEvent;
76 struct TextInputState; 77 struct TextInputState;
77 78
78 // Basic implementation shared by concrete RenderWidgetHostView subclasses. 79 // Basic implementation shared by concrete RenderWidgetHostView subclasses.
79 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, 80 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
80 public IPC::Listener { 81 public IPC::Listener {
81 public: 82 public:
82 ~RenderWidgetHostViewBase() override; 83 ~RenderWidgetHostViewBase() override;
83 84
84 float current_device_scale_factor() const { 85 float current_device_scale_factor() const {
85 return current_device_scale_factor_; 86 return current_device_scale_factor_;
86 } 87 }
87 88
88 // Returns the focused RenderWidgetHost inside this |view|'s RWH. 89 // Returns the focused RenderWidgetHost inside this |view|'s RWH.
89 RenderWidgetHostImpl* GetFocusedWidget() const; 90 RenderWidgetHostImpl* GetFocusedWidget() const;
90 91
91 // RenderWidgetHostView implementation. 92 // RenderWidgetHostView implementation.
92 RenderWidgetHost* GetRenderWidgetHost() const override; 93 RenderWidgetHost* GetRenderWidgetHost() const override;
93 void SetBackgroundColor(SkColor color) override; 94 void SetBackgroundColor(SkColor color) override;
94 void SetBackgroundColorToDefault() final; 95 void SetBackgroundColorToDefault() final;
95 bool GetBackgroundOpaque() override; 96 bool GetBackgroundOpaque() override;
96 ui::TextInputClient* GetTextInputClient() override; 97 ui::TextInputClient* GetTextInputClient() override;
98 void GetFocusedFormFieldData(ExtractFormFieldDataCallback& reply) override;
97 void WasUnOccluded() override {} 99 void WasUnOccluded() override {}
98 void WasOccluded() override {} 100 void WasOccluded() override {}
99 bool IsShowingContextMenu() const override; 101 bool IsShowingContextMenu() const override;
100 void SetShowingContextMenu(bool showing_menu) override; 102 void SetShowingContextMenu(bool showing_menu) override;
101 base::string16 GetSelectedText() override; 103 base::string16 GetSelectedText() override;
102 bool IsMouseLocked() override; 104 bool IsMouseLocked() override;
103 gfx::Size GetVisibleViewportSize() const override; 105 gfx::Size GetVisibleViewportSize() const override;
104 void SetInsets(const gfx::Insets& insets) override; 106 void SetInsets(const gfx::Insets& insets) override;
105 void BeginFrameSubscription( 107 void BeginFrameSubscription(
106 std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override; 108 std::unique_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) override;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // RenderWidget's window's origin. Focus and anchor bound are represented as 308 // RenderWidget's window's origin. Focus and anchor bound are represented as
307 // gfx::Rect. 309 // gfx::Rect.
308 virtual void SelectionBoundsChanged( 310 virtual void SelectionBoundsChanged(
309 const ViewHostMsg_SelectionBounds_Params& params); 311 const ViewHostMsg_SelectionBounds_Params& params);
310 312
311 // Updates the range of the marked text in an IME composition. 313 // Updates the range of the marked text in an IME composition.
312 virtual void ImeCompositionRangeChanged( 314 virtual void ImeCompositionRangeChanged(
313 const gfx::Range& range, 315 const gfx::Range& range,
314 const std::vector<gfx::Rect>& character_bounds); 316 const std::vector<gfx::Rect>& character_bounds);
315 317
318 // This method contains response for the FetchTextInputInfo request.
319 void OnFocusedFormFieldDataReply(int request_id,
320 const FormFieldData& field_data);
321
316 //---------------------------------------------------------------------------- 322 //----------------------------------------------------------------------------
317 // The following pure virtual methods are implemented by derived classes. 323 // The following pure virtual methods are implemented by derived classes.
318 324
319 // Perform all the initialization steps necessary for this object to represent 325 // Perform all the initialization steps necessary for this object to represent
320 // a popup (such as a <select> dropdown), then shows the popup at |pos|. 326 // a popup (such as a <select> dropdown), then shows the popup at |pos|.
321 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, 327 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
322 const gfx::Rect& bounds) = 0; 328 const gfx::Rect& bounds) = 0;
323 329
324 // Perform all the initialization steps necessary for this object to represent 330 // Perform all the initialization steps necessary for this object to represent
325 // a full screen window. 331 // a full screen window.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // destroyed before the RWHV is destroyed. 494 // destroyed before the RWHV is destroyed.
489 TextInputManager* text_input_manager_; 495 TextInputManager* text_input_manager_;
490 496
491 private: 497 private:
492 void FlushInput(); 498 void FlushInput();
493 499
494 gfx::Rect current_display_area_; 500 gfx::Rect current_display_area_;
495 501
496 uint32_t renderer_frame_number_; 502 uint32_t renderer_frame_number_;
497 503
504 using FormFieldDataReplyMap = std::map<int, ExtractFormFieldDataCallback>;
Charlie Reis 2016/11/04 20:59:46 Style nit: I think this belongs at the top of the
shaktisahu 2016/11/11 01:15:03 Done.
505 FormFieldDataReplyMap extract_form_field_data_callbacks_;
506
498 base::OneShotTimer flush_input_timer_; 507 base::OneShotTimer flush_input_timer_;
499 508
500 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; 509 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_;
501 510
502 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; 511 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
503 512
504 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); 513 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);
505 }; 514 };
506 515
507 } // namespace content 516 } // namespace content
508 517
509 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ 518 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698