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

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

Issue 2890143003: Move ContextMenu show/hide state tracking to WebContents (Closed)
Patch Set: Remove #if def Created 3 years, 6 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 // Returns the focused RenderWidgetHost inside this |view|'s RWH. 97 // Returns the focused RenderWidgetHost inside this |view|'s RWH.
98 RenderWidgetHostImpl* GetFocusedWidget() const; 98 RenderWidgetHostImpl* GetFocusedWidget() const;
99 99
100 // RenderWidgetHostView implementation. 100 // RenderWidgetHostView implementation.
101 RenderWidgetHost* GetRenderWidgetHost() const override; 101 RenderWidgetHost* GetRenderWidgetHost() const override;
102 void SetBackgroundColorToDefault() final; 102 void SetBackgroundColorToDefault() final;
103 ui::TextInputClient* GetTextInputClient() override; 103 ui::TextInputClient* GetTextInputClient() override;
104 void WasUnOccluded() override {} 104 void WasUnOccluded() override {}
105 void WasOccluded() override {} 105 void WasOccluded() override {}
106 bool IsShowingContextMenu() const override;
107 void SetShowingContextMenu(bool showing_menu) override;
108 void SetIsInVR(bool is_in_vr) override; 106 void SetIsInVR(bool is_in_vr) override;
109 base::string16 GetSelectedText() override; 107 base::string16 GetSelectedText() override;
110 bool IsMouseLocked() override; 108 bool IsMouseLocked() override;
111 gfx::Size GetVisibleViewportSize() const override; 109 gfx::Size GetVisibleViewportSize() const override;
112 void SetInsets(const gfx::Insets& insets) override; 110 void SetInsets(const gfx::Insets& insets) override;
113 bool IsSurfaceAvailableForCopy() const override; 111 bool IsSurfaceAvailableForCopy() const override;
114 void CopyFromSurface(const gfx::Rect& src_rect, 112 void CopyFromSurface(const gfx::Rect& src_rect,
115 const gfx::Size& output_size, 113 const gfx::Size& output_size,
116 const ReadbackRequestCallback& callback, 114 const ReadbackRequestCallback& callback,
117 const SkColorType color_type) override; 115 const SkColorType color_type) override;
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 401
404 // Called by the RenderWidgetHost when an ambiguous gesture is detected to 402 // Called by the RenderWidgetHost when an ambiguous gesture is detected to
405 // show the disambiguation popup bubble. 403 // show the disambiguation popup bubble.
406 virtual void ShowDisambiguationPopup(const gfx::Rect& rect_pixels, 404 virtual void ShowDisambiguationPopup(const gfx::Rect& rect_pixels,
407 const SkBitmap& zoomed_bitmap); 405 const SkBitmap& zoomed_bitmap);
408 406
409 // Called by the WebContentsImpl when a user tries to navigate a new page on 407 // Called by the WebContentsImpl when a user tries to navigate a new page on
410 // main frame. 408 // main frame.
411 virtual void OnDidNavigateMainFrameToNewPage(); 409 virtual void OnDidNavigateMainFrameToNewPage();
412 410
411 // Called by WebContentsImpl to notify the view about a change in visibility
412 // of context menu. The view can then perform platform specific tasks and
413 // changes.
414 virtual void SetShowingContextMenu(bool showing) {}
415
413 // Add and remove observers for lifetime event notifications. The order in 416 // Add and remove observers for lifetime event notifications. The order in
414 // which notifications are sent to observers is undefined. Clients must be 417 // which notifications are sent to observers is undefined. Clients must be
415 // sure to remove the observer before they go away. 418 // sure to remove the observer before they go away.
416 void AddObserver(RenderWidgetHostViewBaseObserver* observer); 419 void AddObserver(RenderWidgetHostViewBaseObserver* observer);
417 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer); 420 void RemoveObserver(RenderWidgetHostViewBaseObserver* observer);
418 421
419 // Returns a reference to the current instance of TextInputManager. The 422 // Returns a reference to the current instance of TextInputManager. The
420 // reference is obtained from RenderWidgetHostDelegate. The first time a non- 423 // reference is obtained from RenderWidgetHostDelegate. The first time a non-
421 // null reference is obtained, its value is cached in |text_input_manager_| 424 // null reference is obtained, its value is cached in |text_input_manager_|
422 // and this view is registered with it. The RWHV will unregister from the 425 // and this view is registered with it. The RWHV will unregister from the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 // autofill...). 461 // autofill...).
459 blink::WebPopupType popup_type_; 462 blink::WebPopupType popup_type_;
460 463
461 // While the mouse is locked, the cursor is hidden from the user. Mouse events 464 // While the mouse is locked, the cursor is hidden from the user. Mouse events
462 // are still generated. However, the position they report is the last known 465 // are still generated. However, the position they report is the last known
463 // mouse position just as mouse lock was entered; the movement they report 466 // mouse position just as mouse lock was entered; the movement they report
464 // indicates what the change in position of the mouse would be had it not been 467 // indicates what the change in position of the mouse would be had it not been
465 // locked. 468 // locked.
466 bool mouse_locked_; 469 bool mouse_locked_;
467 470
468 // Whether we are showing a context menu.
469 bool showing_context_menu_;
470
471 // The scale factor of the display the renderer is currently on. 471 // The scale factor of the display the renderer is currently on.
472 float current_device_scale_factor_; 472 float current_device_scale_factor_;
473 473
474 // The orientation of the display the renderer is currently on. 474 // The orientation of the display the renderer is currently on.
475 display::Display::Rotation current_display_rotation_; 475 display::Display::Rotation current_display_rotation_;
476 476
477 // A reference to current TextInputManager instance this RWHV is registered 477 // A reference to current TextInputManager instance this RWHV is registered
478 // with. This is initially nullptr until the first time the view calls 478 // with. This is initially nullptr until the first time the view calls
479 // GetTextInputManager(). It also becomes nullptr when TextInputManager is 479 // GetTextInputManager(). It also becomes nullptr when TextInputManager is
480 // destroyed before the RWHV is destroyed. 480 // destroyed before the RWHV is destroyed.
481 TextInputManager* text_input_manager_; 481 TextInputManager* text_input_manager_;
482 482
483 const bool wheel_scroll_latching_enabled_; 483 const bool wheel_scroll_latching_enabled_;
484 484
485 private: 485 private:
486 gfx::Rect current_display_area_; 486 gfx::Rect current_display_area_;
487 487
488 uint32_t renderer_frame_number_; 488 uint32_t renderer_frame_number_;
489 489
490 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; 490 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_;
491 491
492 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; 492 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
493 493
494 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); 494 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);
495 }; 495 };
496 496
497 } // namespace content 497 } // namespace content
498 498
499 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ 499 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698