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

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

Issue 12321005: Enable touch based selection and editing for webpages behind a flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 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 | Annotate | Revision Log
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_AURA_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/linked_ptr.h" 13 #include "base/memory/linked_ptr.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "content/browser/renderer_host/image_transport_factory.h" 17 #include "content/browser/renderer_host/image_transport_factory.h"
18 #include "content/browser/renderer_host/render_widget_host_view_base.h" 18 #include "content/browser/renderer_host/render_widget_host_view_base.h"
19 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
20 #include "third_party/skia/include/core/SkRegion.h" 20 #include "third_party/skia/include/core/SkRegion.h"
21 #include "ui/aura/client/activation_change_observer.h" 21 #include "ui/aura/client/activation_change_observer.h"
22 #include "ui/aura/client/activation_delegate.h" 22 #include "ui/aura/client/activation_delegate.h"
23 #include "ui/aura/client/focus_change_observer.h" 23 #include "ui/aura/client/focus_change_observer.h"
24 #include "ui/aura/root_window_observer.h" 24 #include "ui/aura/root_window_observer.h"
25 #include "ui/aura/window_delegate.h" 25 #include "ui/aura/window_delegate.h"
26 #include "ui/base/ime/text_input_client.h" 26 #include "ui/base/ime/text_input_client.h"
27 #include "ui/base/touch/touch_editing_controller.h"
27 #include "ui/compositor/compositor.h" 28 #include "ui/compositor/compositor.h"
28 #include "ui/compositor/compositor_observer.h" 29 #include "ui/compositor/compositor_observer.h"
29 #include "ui/gfx/display_observer.h" 30 #include "ui/gfx/display_observer.h"
30 #include "ui/gfx/rect.h" 31 #include "ui/gfx/rect.h"
31 #include "webkit/glue/webcursor.h" 32 #include "webkit/glue/webcursor.h"
32 33
33 namespace aura { 34 namespace aura {
34 class WindowTracker; 35 class WindowTracker;
35 } 36 }
36 37
(...skipping 17 matching lines...) Expand all
54 : public RenderWidgetHostViewBase, 55 : public RenderWidgetHostViewBase,
55 public ui::CompositorObserver, 56 public ui::CompositorObserver,
56 public ui::TextInputClient, 57 public ui::TextInputClient,
57 public gfx::DisplayObserver, 58 public gfx::DisplayObserver,
58 public aura::RootWindowObserver, 59 public aura::RootWindowObserver,
59 public aura::WindowDelegate, 60 public aura::WindowDelegate,
60 public aura::client::ActivationDelegate, 61 public aura::client::ActivationDelegate,
61 public aura::client::ActivationChangeObserver, 62 public aura::client::ActivationChangeObserver,
62 public aura::client::FocusChangeObserver, 63 public aura::client::FocusChangeObserver,
63 public ImageTransportFactoryObserver, 64 public ImageTransportFactoryObserver,
64 public base::SupportsWeakPtr<RenderWidgetHostViewAura> { 65 public base::SupportsWeakPtr<RenderWidgetHostViewAura>,
66 public ui::TouchEditable {
65 public: 67 public:
66 // Used to notify whenever the paint-content of the view changes. 68 // Used to notify whenever the paint-content of the view changes.
67 class PaintObserver { 69 class PaintObserver {
68 public: 70 public:
69 PaintObserver() {} 71 PaintObserver() {}
70 virtual ~PaintObserver() {} 72 virtual ~PaintObserver() {}
71 73
72 // This is called when painting of the page is completed. 74 // This is called when painting of the page is completed.
73 virtual void OnPaintComplete() = 0; 75 virtual void OnPaintComplete() = 0;
74 76
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 const std::vector<gfx::Rect>& copy_rects) OVERRIDE; 134 const std::vector<gfx::Rect>& copy_rects) OVERRIDE;
133 virtual void RenderViewGone(base::TerminationStatus status, 135 virtual void RenderViewGone(base::TerminationStatus status,
134 int error_code) OVERRIDE; 136 int error_code) OVERRIDE;
135 virtual void Destroy() OVERRIDE; 137 virtual void Destroy() OVERRIDE;
136 virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE; 138 virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE;
137 virtual void SelectionChanged(const string16& text, 139 virtual void SelectionChanged(const string16& text,
138 size_t offset, 140 size_t offset,
139 const ui::Range& range) OVERRIDE; 141 const ui::Range& range) OVERRIDE;
140 virtual void SelectionBoundsChanged( 142 virtual void SelectionBoundsChanged(
141 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE; 143 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE;
144 virtual void TouchEditingHandlesVisibilityChanged(bool visible) OVERRIDE;
142 virtual void ScrollOffsetChanged() OVERRIDE; 145 virtual void ScrollOffsetChanged() OVERRIDE;
143 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; 146 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE;
144 virtual void CopyFromCompositingSurface( 147 virtual void CopyFromCompositingSurface(
145 const gfx::Rect& src_subrect, 148 const gfx::Rect& src_subrect,
146 const gfx::Size& dst_size, 149 const gfx::Size& dst_size,
147 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; 150 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE;
148 virtual void CopyFromCompositingSurfaceToVideoFrame( 151 virtual void CopyFromCompositingSurfaceToVideoFrame(
149 const gfx::Rect& src_subrect, 152 const gfx::Rect& src_subrect,
150 const scoped_refptr<media::VideoFrame>& target, 153 const scoped_refptr<media::VideoFrame>& target,
151 const base::Callback<void(bool)>& callback) OVERRIDE; 154 const base::Callback<void(bool)>& callback) OVERRIDE;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE; 284 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE;
282 virtual void OnCompositingLockStateChanged( 285 virtual void OnCompositingLockStateChanged(
283 ui::Compositor* compositor) OVERRIDE; 286 ui::Compositor* compositor) OVERRIDE;
284 virtual void OnUpdateVSyncParameters(ui::Compositor* compositor, 287 virtual void OnUpdateVSyncParameters(ui::Compositor* compositor,
285 base::TimeTicks timebase, 288 base::TimeTicks timebase,
286 base::TimeDelta interval) OVERRIDE; 289 base::TimeDelta interval) OVERRIDE;
287 290
288 // Overridden from ImageTransportFactoryObserver: 291 // Overridden from ImageTransportFactoryObserver:
289 virtual void OnLostResources() OVERRIDE; 292 virtual void OnLostResources() OVERRIDE;
290 293
294 // Overridden from ui::TouchEditable:
piman 2013/02/22 02:43:04 I think all this should be a tear-off class. RWVHA
varunjain 2013/02/28 20:28:19 Done.
295 virtual void SelectRect(const gfx::Point& start,
296 const gfx::Point& end) OVERRIDE;
297 virtual void GetSelectionEndPoints(gfx::Rect* p1, gfx::Rect* p2) OVERRIDE;
298 virtual gfx::Rect GetBounds() OVERRIDE;
299 virtual gfx::NativeView GetNativeView() OVERRIDE;
300 virtual void ConvertPointToScreen(gfx::Point* point) OVERRIDE;
301 virtual void ConvertPointFromScreen(gfx::Point* point) OVERRIDE;
302 virtual bool DrawsHandles() OVERRIDE;
303 virtual void OpenContextMenu(const gfx::Point anchor) OVERRIDE;
304 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
305 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
306 virtual bool GetAcceleratorForCommandId(
307 int command_id,
308 ui::Accelerator* accelerator) OVERRIDE;
309 virtual void ExecuteCommand(int command_id) OVERRIDE;
310
291 virtual ~RenderWidgetHostViewAura(); 311 virtual ~RenderWidgetHostViewAura();
292 312
293 void UpdateCursorIfOverSelf(); 313 void UpdateCursorIfOverSelf();
294 bool ShouldSkipFrame(const gfx::Size& size); 314 bool ShouldSkipFrame(const gfx::Size& size);
295 void UpdateExternalTexture(); 315 void UpdateExternalTexture();
296 ui::InputMethod* GetInputMethod() const; 316 ui::InputMethod* GetInputMethod() const;
297 317
298 // Returns whether the widget needs an input grab to work properly. 318 // Returns whether the widget needs an input grab to work properly.
299 bool NeedsInputGrab(); 319 bool NeedsInputGrab();
300 320
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // No. We've got a frame, but it hasn't been committed. 523 // No. We've got a frame, but it hasn't been committed.
504 NO_PENDING_COMMIT, 524 NO_PENDING_COMMIT,
505 }; 525 };
506 CanLockCompositorState can_lock_compositor_; 526 CanLockCompositorState can_lock_compositor_;
507 527
508 // An observer to notify that the paint content of the view has changed. The 528 // An observer to notify that the paint content of the view has changed. The
509 // observer is not owned by the view, and must remove itself as an oberver 529 // observer is not owned by the view, and must remove itself as an oberver
510 // when it is being destroyed. 530 // when it is being destroyed.
511 PaintObserver* paint_observer_; 531 PaintObserver* paint_observer_;
512 532
533 scoped_ptr<ui::TouchSelectionController> touch_selection_controller_;
534
513 #if defined(OS_WIN) 535 #if defined(OS_WIN)
514 scoped_ptr<TransientWindowObserver> transient_observer_; 536 scoped_ptr<TransientWindowObserver> transient_observer_;
515 537
516 // The list of rectangles from transient and constrained windows over this 538 // The list of rectangles from transient and constrained windows over this
517 // view. Windowed NPAPI plugins shouldn't draw over them. 539 // view. Windowed NPAPI plugins shouldn't draw over them.
518 std::vector<gfx::Rect> transient_rects_; 540 std::vector<gfx::Rect> transient_rects_;
519 std::vector<gfx::Rect> constrained_rects_; 541 std::vector<gfx::Rect> constrained_rects_;
520 542
521 typedef std::map<HWND, webkit::npapi::WebPluginGeometry> PluginWindowMoves; 543 typedef std::map<HWND, webkit::npapi::WebPluginGeometry> PluginWindowMoves;
522 // Contains information about each windowed plugin's clip and cutout rects ( 544 // Contains information about each windowed plugin's clip and cutout rects (
523 // from the renderer). This is needed because when the transient windoiws 545 // from the renderer). This is needed because when the transient windoiws
524 // over this view changes, we need this information in order to create a new 546 // over this view changes, we need this information in order to create a new
525 // region for the HWND. 547 // region for the HWND.
526 PluginWindowMoves plugin_window_moves_; 548 PluginWindowMoves plugin_window_moves_;
527 #endif 549 #endif
528 550
529 base::TimeTicks last_draw_ended_; 551 base::TimeTicks last_draw_ended_;
530 552
531 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); 553 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
532 }; 554 };
533 555
534 } // namespace content 556 } // namespace content
535 557
536 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ 558 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698