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

Unified 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: Experimenting with single observer design 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_view_aura.h
diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h
index 7d377b05594345d30268104aeb0c7d543fd51bf9..7aa1c7e705d5e8d464231b5dbb0af38e9160c494 100644
--- a/content/browser/web_contents/web_contents_view_aura.h
+++ b/content/browser/web_contents/web_contents_view_aura.h
@@ -10,6 +10,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/browser/renderer_host/overscroll_controller_delegate.h"
+#include "content/browser/web_contents/aura/constrained_windows_observer.h"
+#include "content/browser/web_contents/aura/native_view_screen_bounds_observer.h"
#include "content/common/content_export.h"
#include "content/port/browser/render_view_host_delegate_view.h"
#include "content/port/browser/web_contents_view_port.h"
@@ -39,7 +41,8 @@ class CONTENT_EXPORT WebContentsViewAura
NON_EXPORTED_BASE(public OverscrollControllerDelegate),
public ui::ImplicitAnimationObserver,
public aura::WindowDelegate,
- public aura::client::DragDropDelegate {
+ public aura::client::DragDropDelegate,
+ public NativeViewScreenBoundsObserverDelegate {
public:
WebContentsViewAura(WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate);
@@ -49,8 +52,9 @@ class CONTENT_EXPORT WebContentsViewAura
void SetTouchEditableForTest(TouchEditableImplAura* touch_editable);
private:
- class WindowObserver;
-
+#if defined(OS_WIN)
+ friend ConstrainedWindowsObserver;
+#endif
virtual ~WebContentsViewAura();
void SizeChangedCommon(const gfx::Size& size);
@@ -183,13 +187,26 @@ class CONTENT_EXPORT WebContentsViewAura
virtual void OnDragExited() OVERRIDE;
virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE;
+ // Overriden from NativeViewScreenBoundsObserverDelegate
+ virtual void OnScreenPositionChanged() OVERRIDE;
+ virtual void OnScreenBoundsChanged() OVERRIDE;
+
scoped_ptr<aura::Window> window_;
// The window that shows the screenshot of the history page during an
// overscroll navigation gesture.
scoped_ptr<aura::Window> overscroll_window_;
- scoped_ptr<WindowObserver> window_observer_;
+ // Observes the window associated with the view and its ancestors to track if
+ // the visible bounds of the window have changed. If so it sends an update of
+ // the associated screen rect to the renderer.
+ scoped_ptr<NativeViewScreenBoundsObserver> bounds_observer_;
+
+#if defined(OS_WIN)
+ // Tracks the set of constrained windows for NPAPI plugins and sends bounds
+ // updates when appropriate.
+ scoped_ptr<ConstrainedWindowsObserver> constrained_observer_;
+#endif
// The WebContentsImpl whose contents we display.
WebContentsImpl* web_contents_;

Powered by Google App Engine
This is Rietveld 408576698