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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.h

Issue 54623007: Make code path for bounds changes getting to renderer less brittle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved observer into content/browser/web_contents/aura and added tests Created 7 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 | 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_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 12 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
13 #include "content/browser/web_contents/aura/native_view_screen_bounds_observer.h "
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 #include "content/port/browser/render_view_host_delegate_view.h" 15 #include "content/port/browser/render_view_host_delegate_view.h"
15 #include "content/port/browser/web_contents_view_port.h" 16 #include "content/port/browser/web_contents_view_port.h"
16 #include "ui/aura/client/drag_drop_delegate.h" 17 #include "ui/aura/client/drag_drop_delegate.h"
17 #include "ui/aura/window_delegate.h" 18 #include "ui/aura/window_delegate.h"
18 #include "ui/compositor/layer_animation_observer.h" 19 #include "ui/compositor/layer_animation_observer.h"
19 20
20 namespace aura { 21 namespace aura {
21 class Window; 22 class Window;
22 } 23 }
23 24
24 namespace ui { 25 namespace ui {
25 class DropTargetEvent; 26 class DropTargetEvent;
26 } 27 }
27 28
28 namespace content { 29 namespace content {
29 class OverscrollNavigationOverlay; 30 class OverscrollNavigationOverlay;
30 class ShadowLayerDelegate; 31 class ShadowLayerDelegate;
31 class TouchEditableImplAura; 32 class TouchEditableImplAura;
32 class WebContentsViewDelegate; 33 class WebContentsViewDelegate;
33 class WebContentsImpl; 34 class WebContentsImpl;
34 class WebDragDestDelegate; 35 class WebDragDestDelegate;
35 36
36 class CONTENT_EXPORT WebContentsViewAura 37 class CONTENT_EXPORT WebContentsViewAura
37 : public WebContentsViewPort, 38 : public WebContentsViewPort,
38 public RenderViewHostDelegateView, 39 public RenderViewHostDelegateView,
39 NON_EXPORTED_BASE(public OverscrollControllerDelegate), 40 NON_EXPORTED_BASE(public OverscrollControllerDelegate),
40 public ui::ImplicitAnimationObserver, 41 public ui::ImplicitAnimationObserver,
41 public aura::WindowDelegate, 42 public aura::WindowDelegate,
42 public aura::client::DragDropDelegate { 43 public aura::client::DragDropDelegate,
44 public NativeViewScreenBoundsObserverDelegate {
43 public: 45 public:
44 WebContentsViewAura(WebContentsImpl* web_contents, 46 WebContentsViewAura(WebContentsImpl* web_contents,
45 WebContentsViewDelegate* delegate); 47 WebContentsViewDelegate* delegate);
46 48
47 void SetupOverlayWindowForTesting(); 49 void SetupOverlayWindowForTesting();
48 50
49 void SetTouchEditableForTest(TouchEditableImplAura* touch_editable); 51 void SetTouchEditableForTest(TouchEditableImplAura* touch_editable);
50 52
51 private: 53 private:
52 class WindowObserver;
53 #if defined(OS_WIN) 54 #if defined(OS_WIN)
54 class ChildWindowObserver; 55 class ChildWindowObserver;
55 #endif 56 #endif
56 57
57 virtual ~WebContentsViewAura(); 58 virtual ~WebContentsViewAura();
58 59
59 void SizeChangedCommon(const gfx::Size& size); 60 void SizeChangedCommon(const gfx::Size& size);
60 61
61 void EndDrag(WebKit::WebDragOperationsMask ops); 62 void EndDrag(WebKit::WebDragOperationsMask ops);
62 63
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // Overridden from ui::EventHandler: 180 // Overridden from ui::EventHandler:
180 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; 181 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
181 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; 182 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
182 183
183 // Overridden from aura::client::DragDropDelegate: 184 // Overridden from aura::client::DragDropDelegate:
184 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; 185 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE;
185 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; 186 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE;
186 virtual void OnDragExited() OVERRIDE; 187 virtual void OnDragExited() OVERRIDE;
187 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; 188 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
188 189
190 // Overriden from NativeViewScreenBoundsObserverDelegate
191 virtual aura::Window* GetDelegateWindow() OVERRIDE;
192 virtual void AddDelegateWindowObserver(aura::WindowObserver* observer)
193 OVERRIDE;
194 virtual void RemoveDelegateWindowObserver(aura::WindowObserver* observer)
195 OVERRIDE;
196 virtual void RemoveRootWindowObserver(aura::RootWindowObserver* observer)
197 OVERRIDE;
198 virtual void AddRootWindowObserver(aura::RootWindowObserver* observer)
199 OVERRIDE;
200 virtual void OnScreenPositionChanged() OVERRIDE;
201 virtual void OnScreenBoundsChanged() OVERRIDE;
202
189 scoped_ptr<aura::Window> window_; 203 scoped_ptr<aura::Window> window_;
190 204
191 // The window that shows the screenshot of the history page during an 205 // The window that shows the screenshot of the history page during an
192 // overscroll navigation gesture. 206 // overscroll navigation gesture.
193 scoped_ptr<aura::Window> overscroll_window_; 207 scoped_ptr<aura::Window> overscroll_window_;
194 208
195 scoped_ptr<WindowObserver> window_observer_; 209 scoped_ptr<NativeViewScreenBoundsObserver> bounds_observer_;
196 #if defined(OS_WIN) 210 #if defined(OS_WIN)
197 scoped_ptr<ChildWindowObserver> child_window_observer_; 211 scoped_ptr<ChildWindowObserver> child_window_observer_;
198 #endif 212 #endif
199 213
200 // The WebContentsImpl whose contents we display. 214 // The WebContentsImpl whose contents we display.
201 WebContentsImpl* web_contents_; 215 WebContentsImpl* web_contents_;
202 216
203 scoped_ptr<WebContentsViewDelegate> delegate_; 217 scoped_ptr<WebContentsViewDelegate> delegate_;
204 218
205 WebKit::WebDragOperationsMask current_drag_op_; 219 WebKit::WebDragOperationsMask current_drag_op_;
(...skipping 24 matching lines...) Expand all
230 scoped_ptr<ShadowLayerDelegate> overscroll_shadow_; 244 scoped_ptr<ShadowLayerDelegate> overscroll_shadow_;
231 245
232 scoped_ptr<TouchEditableImplAura> touch_editable_; 246 scoped_ptr<TouchEditableImplAura> touch_editable_;
233 247
234 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); 248 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura);
235 }; 249 };
236 250
237 } // namespace content 251 } // namespace content
238 252
239 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 253 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698