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/browser/renderer_host/render_view_host_delegate_view.h" | 13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
14 #include "content/browser/web_contents/web_contents_view.h" | 14 #include "content/browser/web_contents/web_contents_view.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "content/public/browser/web_contents_observer.h" |
16 #include "ui/aura/window_delegate.h" | 17 #include "ui/aura/window_delegate.h" |
17 #include "ui/aura/window_observer.h" | 18 #include "ui/aura/window_observer.h" |
18 #include "ui/compositor/layer_animation_observer.h" | 19 #include "ui/compositor/layer_animation_observer.h" |
19 #include "ui/wm/public/drag_drop_delegate.h" | 20 #include "ui/wm/public/drag_drop_delegate.h" |
20 | 21 |
21 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
22 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" | 23 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" |
23 #include "content/browser/renderer_host/legacy_render_widget_host_win_delegate.h
" | 24 #include "content/browser/renderer_host/legacy_render_widget_host_win_delegate.h
" |
24 #endif | 25 #endif |
25 | 26 |
(...skipping 23 matching lines...) Expand all Loading... |
49 class WebContentsViewAura | 50 class WebContentsViewAura |
50 : public WebContentsView, | 51 : public WebContentsView, |
51 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
52 public LegacyRenderWidgetHostHWNDDelegate, | 53 public LegacyRenderWidgetHostHWNDDelegate, |
53 #endif | 54 #endif |
54 public RenderViewHostDelegateView, | 55 public RenderViewHostDelegateView, |
55 public OverscrollControllerDelegate, | 56 public OverscrollControllerDelegate, |
56 public ui::ImplicitAnimationObserver, | 57 public ui::ImplicitAnimationObserver, |
57 public aura::WindowDelegate, | 58 public aura::WindowDelegate, |
58 public aura::client::DragDropDelegate, | 59 public aura::client::DragDropDelegate, |
59 public aura::WindowObserver { | 60 public aura::WindowObserver, |
| 61 public WebContentsObserver { |
60 public: | 62 public: |
61 WebContentsViewAura(WebContentsImpl* web_contents, | 63 WebContentsViewAura(WebContentsImpl* web_contents, |
62 WebContentsViewDelegate* delegate); | 64 WebContentsViewDelegate* delegate); |
63 | 65 |
64 CONTENT_EXPORT void SetTouchEditableForTest( | 66 CONTENT_EXPORT void SetTouchEditableForTest( |
65 TouchEditableImplAura* touch_editable); | 67 TouchEditableImplAura* touch_editable); |
66 | 68 |
67 private: | 69 private: |
68 class WindowObserver; | 70 class WindowObserver; |
69 | 71 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Overridden from ui::EventHandler: | 191 // Overridden from ui::EventHandler: |
190 void OnKeyEvent(ui::KeyEvent* event) override; | 192 void OnKeyEvent(ui::KeyEvent* event) override; |
191 void OnMouseEvent(ui::MouseEvent* event) override; | 193 void OnMouseEvent(ui::MouseEvent* event) override; |
192 | 194 |
193 // Overridden from aura::client::DragDropDelegate: | 195 // Overridden from aura::client::DragDropDelegate: |
194 void OnDragEntered(const ui::DropTargetEvent& event) override; | 196 void OnDragEntered(const ui::DropTargetEvent& event) override; |
195 int OnDragUpdated(const ui::DropTargetEvent& event) override; | 197 int OnDragUpdated(const ui::DropTargetEvent& event) override; |
196 void OnDragExited() override; | 198 void OnDragExited() override; |
197 int OnPerformDrop(const ui::DropTargetEvent& event) override; | 199 int OnPerformDrop(const ui::DropTargetEvent& event) override; |
198 | 200 |
| 201 // Overridden from WebContentsObserver: |
| 202 void RenderProcessGone(base::TerminationStatus status) override; |
| 203 |
199 // Overridden from aura::WindowObserver: | 204 // Overridden from aura::WindowObserver: |
200 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; | 205 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override; |
201 | 206 |
202 // Update the web contents visiblity. | 207 // Update the web contents visiblity. |
203 void UpdateWebContentsVisibility(bool visible); | 208 void UpdateWebContentsVisibility(bool visible); |
204 | 209 |
205 #if defined(OS_WIN) | 210 #if defined(OS_WIN) |
206 // Overridden from LegacyRenderWidgetHostHWNDDelegate: | 211 // Overridden from LegacyRenderWidgetHostHWNDDelegate: |
207 virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; | 212 virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; |
| 213 |
| 214 void UpdateLegacyHwndVisibility(); |
208 #endif | 215 #endif |
209 | 216 |
210 scoped_ptr<aura::Window> window_; | 217 scoped_ptr<aura::Window> window_; |
211 | 218 |
212 // The window that shows the screenshot of the history page during an | 219 // The window that shows the screenshot of the history page during an |
213 // overscroll navigation gesture. | 220 // overscroll navigation gesture. |
214 scoped_ptr<aura::Window> overscroll_window_; | 221 scoped_ptr<aura::Window> overscroll_window_; |
215 | 222 |
216 scoped_ptr<WindowObserver> window_observer_; | 223 scoped_ptr<WindowObserver> window_observer_; |
217 | 224 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // On Windows we can run into problems if resources get released within the | 268 // On Windows we can run into problems if resources get released within the |
262 // initialization phase while the content (and its dimensions) are not known. | 269 // initialization phase while the content (and its dimensions) are not known. |
263 bool is_or_was_visible_; | 270 bool is_or_was_visible_; |
264 | 271 |
265 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); | 272 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); |
266 }; | 273 }; |
267 | 274 |
268 } // namespace content | 275 } // namespace content |
269 | 276 |
270 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ | 277 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ |
OLD | NEW |