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

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

Issue 2213503002: Tracking SelectionBounds for all RenderWidgets on the Browser Side (Mac) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a crash Created 4 years, 4 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_MAC_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <IOSurface/IOSurface.h> 9 #include <IOSurface/IOSurface.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 void ImeCompositionRangeChanged( 288 void ImeCompositionRangeChanged(
289 const gfx::Range& range, 289 const gfx::Range& range,
290 const std::vector<gfx::Rect>& character_bounds) override; 290 const std::vector<gfx::Rect>& character_bounds) override;
291 void RenderProcessGone(base::TerminationStatus status, 291 void RenderProcessGone(base::TerminationStatus status,
292 int error_code) override; 292 int error_code) override;
293 void Destroy() override; 293 void Destroy() override;
294 void SetTooltipText(const base::string16& tooltip_text) override; 294 void SetTooltipText(const base::string16& tooltip_text) override;
295 void SelectionChanged(const base::string16& text, 295 void SelectionChanged(const base::string16& text,
296 size_t offset, 296 size_t offset,
297 const gfx::Range& range) override; 297 const gfx::Range& range) override;
298 void SelectionBoundsChanged(
299 const ViewHostMsg_SelectionBounds_Params& params) override;
300 void CopyFromCompositingSurface(const gfx::Rect& src_subrect, 298 void CopyFromCompositingSurface(const gfx::Rect& src_subrect,
301 const gfx::Size& dst_size, 299 const gfx::Size& dst_size,
302 const ReadbackRequestCallback& callback, 300 const ReadbackRequestCallback& callback,
303 SkColorType preferred_color_type) override; 301 SkColorType preferred_color_type) override;
304 void CopyFromCompositingSurfaceToVideoFrame( 302 void CopyFromCompositingSurfaceToVideoFrame(
305 const gfx::Rect& src_subrect, 303 const gfx::Rect& src_subrect,
306 const scoped_refptr<media::VideoFrame>& target, 304 const scoped_refptr<media::VideoFrame>& target,
307 const base::Callback<void(const gfx::Rect&, bool)>& callback) override; 305 const base::Callback<void(const gfx::Rect&, bool)>& callback) override;
308 bool CanCopyToVideoFrame() const override; 306 bool CanCopyToVideoFrame() const override;
309 void BeginFrameSubscription( 307 void BeginFrameSubscription(
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 461
464 // AcceleratedWidgetMacNSView implementation. 462 // AcceleratedWidgetMacNSView implementation.
465 NSView* AcceleratedWidgetGetNSView() const override; 463 NSView* AcceleratedWidgetGetNSView() const override;
466 void AcceleratedWidgetGetVSyncParameters( 464 void AcceleratedWidgetGetVSyncParameters(
467 base::TimeTicks* timebase, base::TimeDelta* interval) const override; 465 base::TimeTicks* timebase, base::TimeDelta* interval) const override;
468 void AcceleratedWidgetSwapCompleted() override; 466 void AcceleratedWidgetSwapCompleted() override;
469 467
470 // Exposed for testing. 468 // Exposed for testing.
471 cc::SurfaceId SurfaceIdForTesting() const override; 469 cc::SurfaceId SurfaceIdForTesting() const override;
472 470
471 // This helper method will return the active widget from TextInputManager if
472 // it exists. Otherwise, it will return |render_widget_host_|.
473 RenderWidgetHostImpl* GetActiveWidget();
474
473 // Helper method to obtain ui::TextInputType for the active widget from the 475 // Helper method to obtain ui::TextInputType for the active widget from the
474 // TextInputManager. 476 // TextInputManager.
475 ui::TextInputType GetTextInputType(); 477 ui::TextInputType GetTextInputType();
476 478
477 private: 479 private:
478 friend class RenderWidgetHostViewMacTest; 480 friend class RenderWidgetHostViewMacTest;
479 481
480 // Returns whether this render view is a popup (autocomplete window). 482 // Returns whether this render view is a popup (autocomplete window).
481 bool IsPopup() const; 483 bool IsPopup() const;
482 484
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 533
532 // The current VSync timebase and interval. This is zero until the first call 534 // The current VSync timebase and interval. This is zero until the first call
533 // to SendVSyncParametersToRenderer(), and refreshed regularly thereafter. 535 // to SendVSyncParametersToRenderer(), and refreshed regularly thereafter.
534 base::TimeTicks vsync_timebase_; 536 base::TimeTicks vsync_timebase_;
535 base::TimeDelta vsync_interval_; 537 base::TimeDelta vsync_interval_;
536 538
537 // The current composition character range and its bounds. 539 // The current composition character range and its bounds.
538 gfx::Range composition_range_; 540 gfx::Range composition_range_;
539 std::vector<gfx::Rect> composition_bounds_; 541 std::vector<gfx::Rect> composition_bounds_;
540 542
541 // The current caret bounds.
542 gfx::Rect caret_rect_;
543
544 // The current first selection bounds.
545 gfx::Rect first_selection_rect_;
546
547 // Factory used to safely scope delayed calls to ShutdownHost(). 543 // Factory used to safely scope delayed calls to ShutdownHost().
548 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_; 544 base::WeakPtrFactory<RenderWidgetHostViewMac> weak_factory_;
549 545
550 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 546 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
551 }; 547 };
552 548
553 } // namespace content 549 } // namespace content
554 550
555 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 551 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698