OLD | NEW |
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/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/port/browser/render_view_host_delegate_view.h" | 14 #include "content/port/browser/render_view_host_delegate_view.h" |
15 #include "content/public/browser/web_contents_view.h" | 15 #include "content/public/browser/web_contents_view.h" |
16 #include "ui/aura/client/drag_drop_delegate.h" | 16 #include "ui/aura/client/drag_drop_delegate.h" |
17 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
18 #include "ui/compositor/layer_animation_observer.h" | 18 #include "ui/compositor/layer_animation_observer.h" |
19 | 19 |
20 namespace aura { | 20 namespace aura { |
21 class Window; | 21 class Window; |
22 } | 22 } |
23 | 23 |
24 namespace ui { | 24 namespace ui { |
25 class DropTargetEvent; | 25 class DropTargetEvent; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 class OverscrollNavigationOverlay; | 29 class OverscrollNavigationOverlay; |
| 30 class ShadowWindow; |
30 class WebContentsViewDelegate; | 31 class WebContentsViewDelegate; |
31 class WebContentsImpl; | 32 class WebContentsImpl; |
32 class WebDragDestDelegate; | 33 class WebDragDestDelegate; |
33 | 34 |
34 class CONTENT_EXPORT WebContentsViewAura | 35 class CONTENT_EXPORT WebContentsViewAura |
35 : public WebContentsView, | 36 : public WebContentsView, |
36 public RenderViewHostDelegateView, | 37 public RenderViewHostDelegateView, |
37 NON_EXPORTED_BASE(public OverscrollControllerDelegate), | 38 NON_EXPORTED_BASE(public OverscrollControllerDelegate), |
38 public ui::ImplicitAnimationObserver, | 39 public ui::ImplicitAnimationObserver, |
39 public aura::WindowDelegate, | 40 public aura::WindowDelegate, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; | 166 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; |
166 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 167 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; |
167 | 168 |
168 // Overridden from aura::client::DragDropDelegate: | 169 // Overridden from aura::client::DragDropDelegate: |
169 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; | 170 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
170 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; | 171 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
171 virtual void OnDragExited() OVERRIDE; | 172 virtual void OnDragExited() OVERRIDE; |
172 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; | 173 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
173 | 174 |
174 scoped_ptr<aura::Window> window_; | 175 scoped_ptr<aura::Window> window_; |
| 176 |
| 177 // The window that shows the screenshot of the history page during an |
| 178 // overscroll navigation gesture. |
175 scoped_ptr<aura::Window> overscroll_window_; | 179 scoped_ptr<aura::Window> overscroll_window_; |
176 | 180 |
177 scoped_ptr<WindowObserver> window_observer_; | 181 scoped_ptr<WindowObserver> window_observer_; |
178 | 182 |
179 // The WebContentsImpl whose contents we display. | 183 // The WebContentsImpl whose contents we display. |
180 WebContentsImpl* web_contents_; | 184 WebContentsImpl* web_contents_; |
181 | 185 |
182 scoped_ptr<WebContentsViewDelegate> delegate_; | 186 scoped_ptr<WebContentsViewDelegate> delegate_; |
183 | 187 |
184 WebKit::WebDragOperationsMask current_drag_op_; | 188 WebKit::WebDragOperationsMask current_drag_op_; |
185 | 189 |
186 scoped_ptr<WebDropData> current_drop_data_; | 190 scoped_ptr<WebDropData> current_drop_data_; |
187 | 191 |
188 WebDragDestDelegate* drag_dest_delegate_; | 192 WebDragDestDelegate* drag_dest_delegate_; |
189 | 193 |
190 // We keep track of the render view host we're dragging over. If it changes | 194 // We keep track of the render view host we're dragging over. If it changes |
191 // during a drag, we need to re-send the DragEnter message. WARNING: | 195 // during a drag, we need to re-send the DragEnter message. WARNING: |
192 // this pointer should never be dereferenced. We only use it for comparing | 196 // this pointer should never be dereferenced. We only use it for comparing |
193 // pointers. | 197 // pointers. |
194 void* current_rvh_for_drag_; | 198 void* current_rvh_for_drag_; |
195 | 199 |
| 200 // The container for the content-window. The doc for ShadowWindow explains its |
| 201 // lifetime and ownership. |
| 202 ShadowWindow* content_container_; |
| 203 |
196 bool overscroll_change_brightness_; | 204 bool overscroll_change_brightness_; |
197 | 205 |
198 // The overscroll gesture currently in progress. | 206 // The overscroll gesture currently in progress. |
199 OverscrollMode current_overscroll_gesture_; | 207 OverscrollMode current_overscroll_gesture_; |
200 | 208 |
201 // This is the completed overscroll gesture. This is used for the animation | 209 // This is the completed overscroll gesture. This is used for the animation |
202 // callback that happens in response to a completed overscroll gesture. | 210 // callback that happens in response to a completed overscroll gesture. |
203 OverscrollMode completed_overscroll_gesture_; | 211 OverscrollMode completed_overscroll_gesture_; |
204 | 212 |
205 // This manages the overlay window that shows the screenshot during a history | 213 // This manages the overlay window that shows the screenshot during a history |
206 // navigation triggered by the overscroll gesture. | 214 // navigation triggered by the overscroll gesture. |
207 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; | 215 scoped_ptr<OverscrollNavigationOverlay> navigation_overlay_; |
208 | 216 |
209 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); | 217 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); |
210 }; | 218 }; |
211 | 219 |
212 } // namespace content | 220 } // namespace content |
213 | 221 |
214 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 222 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
OLD | NEW |