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 #include "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 12 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
13 #include "content/browser/download/drag_download_util.h" | 13 #include "content/browser/download/drag_download_util.h" |
14 #include "content/browser/frame_host/interstitial_page_impl.h" | 14 #include "content/browser/frame_host/interstitial_page_impl.h" |
15 #include "content/browser/frame_host/navigation_entry_impl.h" | 15 #include "content/browser/frame_host/navigation_entry_impl.h" |
16 #include "content/browser/renderer_host/dip_util.h" | 16 #include "content/browser/renderer_host/dip_util.h" |
17 #include "content/browser/renderer_host/overscroll_controller.h" | 17 #include "content/browser/renderer_host/overscroll_controller.h" |
18 #include "content/browser/renderer_host/render_view_host_factory.h" | 18 #include "content/browser/renderer_host/render_view_host_factory.h" |
19 #include "content/browser/renderer_host/render_view_host_impl.h" | 19 #include "content/browser/renderer_host/render_view_host_impl.h" |
20 #include "content/browser/renderer_host/render_widget_host_impl.h" | 20 #include "content/browser/renderer_host/render_widget_host_impl.h" |
21 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 21 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
22 #include "content/browser/renderer_host/web_input_event_aura.h" | 22 #include "content/browser/renderer_host/web_input_event_aura.h" |
23 #include "content/browser/web_contents/aura/gesture_nav_simple.h" | 23 #include "content/browser/web_contents/aura/gesture_nav_simple.h" |
24 #include "content/browser/web_contents/aura/image_window_delegate.h" | |
25 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" | 24 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
26 #include "content/browser/web_contents/aura/shadow_layer_delegate.h" | 25 #include "content/browser/web_contents/aura/shadow_layer_delegate.h" |
27 #include "content/browser/web_contents/aura/window_slider.h" | 26 #include "content/browser/web_contents/aura/window_slider.h" |
28 #include "content/browser/web_contents/touch_editable_impl_aura.h" | 27 #include "content/browser/web_contents/touch_editable_impl_aura.h" |
29 #include "content/browser/web_contents/web_contents_impl.h" | 28 #include "content/browser/web_contents/web_contents_impl.h" |
30 #include "content/public/browser/content_browser_client.h" | 29 #include "content/public/browser/content_browser_client.h" |
31 #include "content/public/browser/notification_observer.h" | 30 #include "content/public/browser/notification_observer.h" |
32 #include "content/public/browser/notification_registrar.h" | 31 #include "content/public/browser/notification_registrar.h" |
33 #include "content/public/browser/notification_source.h" | 32 #include "content/public/browser/notification_source.h" |
34 #include "content/public/browser/notification_types.h" | 33 #include "content/public/browser/notification_types.h" |
(...skipping 10 matching lines...) Expand all Loading... |
45 #include "content/public/common/drop_data.h" | 44 #include "content/public/common/drop_data.h" |
46 #include "net/base/filename_util.h" | 45 #include "net/base/filename_util.h" |
47 #include "third_party/WebKit/public/web/WebInputEvent.h" | 46 #include "third_party/WebKit/public/web/WebInputEvent.h" |
48 #include "ui/aura/client/aura_constants.h" | 47 #include "ui/aura/client/aura_constants.h" |
49 #include "ui/aura/client/window_tree_client.h" | 48 #include "ui/aura/client/window_tree_client.h" |
50 #include "ui/aura/env.h" | 49 #include "ui/aura/env.h" |
51 #include "ui/aura/window.h" | 50 #include "ui/aura/window.h" |
52 #include "ui/aura/window_observer.h" | 51 #include "ui/aura/window_observer.h" |
53 #include "ui/aura/window_tree_host.h" | 52 #include "ui/aura/window_tree_host.h" |
54 #include "ui/aura/window_tree_host_observer.h" | 53 #include "ui/aura/window_tree_host_observer.h" |
| 54 #include "ui/aura_extra/image_window_delegate.h" |
55 #include "ui/base/clipboard/clipboard.h" | 55 #include "ui/base/clipboard/clipboard.h" |
56 #include "ui/base/clipboard/custom_data_helper.h" | 56 #include "ui/base/clipboard/custom_data_helper.h" |
57 #include "ui/base/dragdrop/drag_drop_types.h" | 57 #include "ui/base/dragdrop/drag_drop_types.h" |
58 #include "ui/base/dragdrop/drag_utils.h" | 58 #include "ui/base/dragdrop/drag_utils.h" |
59 #include "ui/base/dragdrop/drop_target_event.h" | 59 #include "ui/base/dragdrop/drop_target_event.h" |
60 #include "ui/base/dragdrop/os_exchange_data.h" | 60 #include "ui/base/dragdrop/os_exchange_data.h" |
61 #include "ui/base/hit_test.h" | 61 #include "ui/base/hit_test.h" |
62 #include "ui/compositor/layer.h" | 62 #include "ui/compositor/layer.h" |
63 #include "ui/compositor/scoped_layer_animation_settings.h" | 63 #include "ui/compositor/scoped_layer_animation_settings.h" |
64 #include "ui/events/event.h" | 64 #include "ui/events/event.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( | 109 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( |
110 rvh ? WebContents::FromRenderViewHost(rvh) : NULL); | 110 rvh ? WebContents::FromRenderViewHost(rvh) : NULL); |
111 if (BrowserPluginGuest::IsGuest(web_contents)) | 111 if (BrowserPluginGuest::IsGuest(web_contents)) |
112 return NULL; | 112 return NULL; |
113 return static_cast<RenderWidgetHostViewAura*>(view); | 113 return static_cast<RenderWidgetHostViewAura*>(view); |
114 } | 114 } |
115 | 115 |
116 // The window delegate for the overscroll window. This redirects trackpad events | 116 // The window delegate for the overscroll window. This redirects trackpad events |
117 // to the web-contents window. The delegate destroys itself when the window is | 117 // to the web-contents window. The delegate destroys itself when the window is |
118 // destroyed. | 118 // destroyed. |
119 class OverscrollWindowDelegate : public ImageWindowDelegate { | 119 class OverscrollWindowDelegate : public aura_extra::ImageWindowDelegate { |
120 public: | 120 public: |
121 OverscrollWindowDelegate(WebContentsImpl* web_contents, | 121 OverscrollWindowDelegate(WebContentsImpl* web_contents, |
122 OverscrollMode overscroll_mode) | 122 OverscrollMode overscroll_mode) |
123 : web_contents_(web_contents), | 123 : web_contents_(web_contents), |
124 forward_events_(true) { | 124 forward_events_(true) { |
125 const NavigationControllerImpl& controller = web_contents->GetController(); | 125 const NavigationControllerImpl& controller = web_contents->GetController(); |
126 const NavigationEntryImpl* entry = NULL; | 126 const NavigationEntryImpl* entry = NULL; |
127 if (ShouldNavigateForward(controller, overscroll_mode)) { | 127 if (ShouldNavigateForward(controller, overscroll_mode)) { |
128 entry = NavigationEntryImpl::FromNavigationEntry( | 128 entry = NavigationEntryImpl::FromNavigationEntry( |
129 controller.GetEntryAtOffset(1)); | 129 controller.GetEntryAtOffset(1)); |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 if (visible) { | 1633 if (visible) { |
1634 if (!web_contents_->should_normally_be_visible()) | 1634 if (!web_contents_->should_normally_be_visible()) |
1635 web_contents_->WasShown(); | 1635 web_contents_->WasShown(); |
1636 } else { | 1636 } else { |
1637 if (web_contents_->should_normally_be_visible()) | 1637 if (web_contents_->should_normally_be_visible()) |
1638 web_contents_->WasHidden(); | 1638 web_contents_->WasHidden(); |
1639 } | 1639 } |
1640 } | 1640 } |
1641 | 1641 |
1642 } // namespace content | 1642 } // namespace content |
OLD | NEW |