| 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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 11 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 12 #include "content/browser/download/drag_download_util.h" | 12 #include "content/browser/download/drag_download_util.h" |
| 13 #include "content/browser/frame_host/interstitial_page_impl.h" | 13 #include "content/browser/frame_host/interstitial_page_impl.h" |
| 14 #include "content/browser/frame_host/navigation_entry_impl.h" | 14 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 15 #include "content/browser/renderer_host/dip_util.h" | 15 #include "content/browser/renderer_host/dip_util.h" |
| 16 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
| 16 #include "content/browser/renderer_host/overscroll_controller.h" | 17 #include "content/browser/renderer_host/overscroll_controller.h" |
| 17 #include "content/browser/renderer_host/render_view_host_factory.h" | 18 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 18 #include "content/browser/renderer_host/render_view_host_impl.h" | 19 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 19 #include "content/browser/renderer_host/render_widget_host_impl.h" | 20 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 21 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 21 #include "content/browser/renderer_host/web_input_event_aura.h" | 22 #include "content/browser/renderer_host/web_input_event_aura.h" |
| 22 #include "content/browser/web_contents/aura/gesture_nav_simple.h" | 23 #include "content/browser/web_contents/aura/gesture_nav_simple.h" |
| 23 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" | 24 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
| 24 #include "content/browser/web_contents/touch_editable_impl_aura.h" | |
| 25 #include "content/browser/web_contents/web_contents_impl.h" | 25 #include "content/browser/web_contents/web_contents_impl.h" |
| 26 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
| 27 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
| 28 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
| 29 #include "content/public/browser/notification_source.h" | 29 #include "content/public/browser/notification_source.h" |
| 30 #include "content/public/browser/notification_types.h" | 30 #include "content/public/browser/notification_types.h" |
| 31 #include "content/public/browser/overscroll_configuration.h" | 31 #include "content/public/browser/overscroll_configuration.h" |
| 32 #include "content/public/browser/render_view_host.h" | 32 #include "content/public/browser/render_view_host.h" |
| 33 #include "content/public/browser/render_widget_host.h" | 33 #include "content/public/browser/render_widget_host.h" |
| 34 #include "content/public/browser/render_widget_host_view.h" | 34 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 56 #include "ui/base/dragdrop/os_exchange_data.h" | 56 #include "ui/base/dragdrop/os_exchange_data.h" |
| 57 #include "ui/base/hit_test.h" | 57 #include "ui/base/hit_test.h" |
| 58 #include "ui/compositor/layer.h" | 58 #include "ui/compositor/layer.h" |
| 59 #include "ui/events/event.h" | 59 #include "ui/events/event.h" |
| 60 #include "ui/events/event_utils.h" | 60 #include "ui/events/event_utils.h" |
| 61 #include "ui/gfx/canvas.h" | 61 #include "ui/gfx/canvas.h" |
| 62 #include "ui/gfx/image/image.h" | 62 #include "ui/gfx/image/image.h" |
| 63 #include "ui/gfx/image/image_png_rep.h" | 63 #include "ui/gfx/image/image_png_rep.h" |
| 64 #include "ui/gfx/image/image_skia.h" | 64 #include "ui/gfx/image/image_skia.h" |
| 65 #include "ui/gfx/screen.h" | 65 #include "ui/gfx/screen.h" |
| 66 #include "ui/touch_selection/touch_selection_controller.h" |
| 66 #include "ui/wm/public/drag_drop_client.h" | 67 #include "ui/wm/public/drag_drop_client.h" |
| 67 #include "ui/wm/public/drag_drop_delegate.h" | 68 #include "ui/wm/public/drag_drop_delegate.h" |
| 68 | 69 |
| 69 namespace content { | 70 namespace content { |
| 70 WebContentsView* CreateWebContentsView( | 71 WebContentsView* CreateWebContentsView( |
| 71 WebContentsImpl* web_contents, | 72 WebContentsImpl* web_contents, |
| 72 WebContentsViewDelegate* delegate, | 73 WebContentsViewDelegate* delegate, |
| 73 RenderViewHostDelegateView** render_view_host_delegate_view) { | 74 RenderViewHostDelegateView** render_view_host_delegate_view) { |
| 74 WebContentsViewAura* rv = new WebContentsViewAura(web_contents, delegate); | 75 WebContentsViewAura* rv = new WebContentsViewAura(web_contents, delegate); |
| 75 *render_view_host_delegate_view = rv; | 76 *render_view_host_delegate_view = rv; |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 } | 524 } |
| 524 #endif | 525 #endif |
| 525 } | 526 } |
| 526 } | 527 } |
| 527 | 528 |
| 528 void OnWindowBoundsChanged(aura::Window* window, | 529 void OnWindowBoundsChanged(aura::Window* window, |
| 529 const gfx::Rect& old_bounds, | 530 const gfx::Rect& old_bounds, |
| 530 const gfx::Rect& new_bounds) override { | 531 const gfx::Rect& new_bounds) override { |
| 531 if (window == host_window_ || window == view_->window_) { | 532 if (window == host_window_ || window == view_->window_) { |
| 532 SendScreenRects(); | 533 SendScreenRects(); |
| 533 if (view_->touch_editable_) | 534 if (old_bounds.origin() != new_bounds.origin()) { |
| 534 view_->touch_editable_->UpdateEditingController(); | 535 TouchSelectionControllerClientAura* selection_controller_client = |
| 536 view_->GetSelectionControllerClient(); |
| 537 if (selection_controller_client) |
| 538 selection_controller_client->OnWindowMoved(); |
| 539 } |
| 535 #if defined(OS_WIN) | 540 #if defined(OS_WIN) |
| 536 } else { | 541 } else { |
| 537 UpdateConstrainedWindows(NULL); | 542 UpdateConstrainedWindows(NULL); |
| 538 #endif | 543 #endif |
| 539 } | 544 } |
| 540 } | 545 } |
| 541 | 546 |
| 542 void OnWindowDestroying(aura::Window* window) override { | 547 void OnWindowDestroying(aura::Window* window) override { |
| 543 if (window == host_window_) { | 548 if (window == host_window_) { |
| 544 host_window_->RemoveObserver(this); | 549 host_window_->RemoveObserver(this); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents, | 647 WebContentsViewAura::WebContentsViewAura(WebContentsImpl* web_contents, |
| 643 WebContentsViewDelegate* delegate) | 648 WebContentsViewDelegate* delegate) |
| 644 : web_contents_(web_contents), | 649 : web_contents_(web_contents), |
| 645 delegate_(delegate), | 650 delegate_(delegate), |
| 646 current_drag_op_(blink::WebDragOperationNone), | 651 current_drag_op_(blink::WebDragOperationNone), |
| 647 drag_dest_delegate_(NULL), | 652 drag_dest_delegate_(NULL), |
| 648 current_rvh_for_drag_(NULL), | 653 current_rvh_for_drag_(NULL), |
| 649 current_overscroll_gesture_(OVERSCROLL_NONE), | 654 current_overscroll_gesture_(OVERSCROLL_NONE), |
| 650 completed_overscroll_gesture_(OVERSCROLL_NONE), | 655 completed_overscroll_gesture_(OVERSCROLL_NONE), |
| 651 navigation_overlay_(nullptr), | 656 navigation_overlay_(nullptr), |
| 652 touch_editable_(TouchEditableImplAura::Create()), | |
| 653 is_or_was_visible_(false) { | 657 is_or_was_visible_(false) { |
| 654 } | 658 } |
| 655 | 659 |
| 656 //////////////////////////////////////////////////////////////////////////////// | 660 //////////////////////////////////////////////////////////////////////////////// |
| 657 // WebContentsViewAura, private: | 661 // WebContentsViewAura, private: |
| 658 | 662 |
| 659 WebContentsViewAura::~WebContentsViewAura() { | 663 WebContentsViewAura::~WebContentsViewAura() { |
| 660 if (!window_) | 664 if (!window_) |
| 661 return; | 665 return; |
| 662 | 666 |
| 663 window_observer_.reset(); | 667 window_observer_.reset(); |
| 664 window_->RemoveObserver(this); | 668 window_->RemoveObserver(this); |
| 665 | 669 |
| 666 // Window needs a valid delegate during its destructor, so we explicitly | 670 // Window needs a valid delegate during its destructor, so we explicitly |
| 667 // delete it here. | 671 // delete it here. |
| 668 window_.reset(); | 672 window_.reset(); |
| 669 } | 673 } |
| 670 | 674 |
| 671 void WebContentsViewAura::SetTouchEditableForTest( | |
| 672 TouchEditableImplAura* touch_editable) { | |
| 673 touch_editable_.reset(touch_editable); | |
| 674 AttachTouchEditableToRenderView(); | |
| 675 } | |
| 676 | |
| 677 void WebContentsViewAura::SizeChangedCommon(const gfx::Size& size) { | 675 void WebContentsViewAura::SizeChangedCommon(const gfx::Size& size) { |
| 678 if (web_contents_->GetInterstitialPage()) | 676 if (web_contents_->GetInterstitialPage()) |
| 679 web_contents_->GetInterstitialPage()->SetSize(size); | 677 web_contents_->GetInterstitialPage()->SetSize(size); |
| 680 RenderWidgetHostView* rwhv = | 678 RenderWidgetHostView* rwhv = |
| 681 web_contents_->GetRenderWidgetHostView(); | 679 web_contents_->GetRenderWidgetHostView(); |
| 682 if (rwhv) | 680 if (rwhv) |
| 683 rwhv->SetSize(size); | 681 rwhv->SetSize(size); |
| 684 } | 682 } |
| 685 | 683 |
| 686 void WebContentsViewAura::EndDrag(blink::WebDragOperationsMask ops) { | 684 void WebContentsViewAura::EndDrag(blink::WebDragOperationsMask ops) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 716 if (!navigation_overlay_) { | 714 if (!navigation_overlay_) { |
| 717 navigation_overlay_.reset( | 715 navigation_overlay_.reset( |
| 718 new OverscrollNavigationOverlay(web_contents_, window_.get())); | 716 new OverscrollNavigationOverlay(web_contents_, window_.get())); |
| 719 } | 717 } |
| 720 } | 718 } |
| 721 | 719 |
| 722 void WebContentsViewAura::CompleteOverscrollNavigation(OverscrollMode mode) { | 720 void WebContentsViewAura::CompleteOverscrollNavigation(OverscrollMode mode) { |
| 723 if (!web_contents_->GetRenderWidgetHostView()) | 721 if (!web_contents_->GetRenderWidgetHostView()) |
| 724 return; | 722 return; |
| 725 navigation_overlay_->relay_delegate()->OnOverscrollComplete(mode); | 723 navigation_overlay_->relay_delegate()->OnOverscrollComplete(mode); |
| 726 if (touch_editable_) | 724 ui::TouchSelectionController* selection_controller = GetSelectionController(); |
| 727 touch_editable_->OverscrollCompleted(); | 725 if (selection_controller) |
| 728 } | 726 selection_controller->HideAndDisallowShowingAutomatically(); |
| 729 | |
| 730 void WebContentsViewAura::AttachTouchEditableToRenderView() { | |
| 731 if (!touch_editable_) | |
| 732 return; | |
| 733 RenderWidgetHostViewAura* rwhva = ToRenderWidgetHostViewAura( | |
| 734 web_contents_->GetRenderWidgetHostView()); | |
| 735 touch_editable_->AttachToView(rwhva); | |
| 736 } | 727 } |
| 737 | 728 |
| 738 void WebContentsViewAura::OverscrollUpdateForWebContentsDelegate( | 729 void WebContentsViewAura::OverscrollUpdateForWebContentsDelegate( |
| 739 float delta_y) { | 730 float delta_y) { |
| 740 if (web_contents_->GetDelegate() && IsScrollEndEffectEnabled()) | 731 if (web_contents_->GetDelegate() && IsScrollEndEffectEnabled()) |
| 741 web_contents_->GetDelegate()->OverscrollUpdate(delta_y); | 732 web_contents_->GetDelegate()->OverscrollUpdate(delta_y); |
| 742 } | 733 } |
| 743 | 734 |
| 735 ui::TouchSelectionController* WebContentsViewAura::GetSelectionController() |
| 736 const { |
| 737 RenderWidgetHostViewAura* view = |
| 738 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); |
| 739 return view ? view->selection_controller() : nullptr; |
| 740 } |
| 741 |
| 742 TouchSelectionControllerClientAura* |
| 743 WebContentsViewAura::GetSelectionControllerClient() const { |
| 744 RenderWidgetHostViewAura* view = |
| 745 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); |
| 746 return view ? view->selection_controller_client() : nullptr; |
| 747 } |
| 748 |
| 744 //////////////////////////////////////////////////////////////////////////////// | 749 //////////////////////////////////////////////////////////////////////////////// |
| 745 // WebContentsViewAura, WebContentsView implementation: | 750 // WebContentsViewAura, WebContentsView implementation: |
| 746 | 751 |
| 747 gfx::NativeView WebContentsViewAura::GetNativeView() const { | 752 gfx::NativeView WebContentsViewAura::GetNativeView() const { |
| 748 return window_.get(); | 753 return window_.get(); |
| 749 } | 754 } |
| 750 | 755 |
| 751 gfx::NativeView WebContentsViewAura::GetContentNativeView() const { | 756 gfx::NativeView WebContentsViewAura::GetContentNativeView() const { |
| 752 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 757 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
| 753 return rwhv ? rwhv->GetNativeView() : NULL; | 758 return rwhv ? rwhv->GetNativeView() : NULL; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 | 896 |
| 892 // We listen to drag drop events in the newly created view's window. | 897 // We listen to drag drop events in the newly created view's window. |
| 893 aura::client::SetDragDropDelegate(view->GetNativeView(), this); | 898 aura::client::SetDragDropDelegate(view->GetNativeView(), this); |
| 894 | 899 |
| 895 if (view->overscroll_controller() && | 900 if (view->overscroll_controller() && |
| 896 (!web_contents_->GetDelegate() || | 901 (!web_contents_->GetDelegate() || |
| 897 web_contents_->GetDelegate()->CanOverscrollContent())) { | 902 web_contents_->GetDelegate()->CanOverscrollContent())) { |
| 898 InstallOverscrollControllerDelegate(view); | 903 InstallOverscrollControllerDelegate(view); |
| 899 } | 904 } |
| 900 | 905 |
| 901 AttachTouchEditableToRenderView(); | |
| 902 return view; | 906 return view; |
| 903 } | 907 } |
| 904 | 908 |
| 905 RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForPopupWidget( | 909 RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForPopupWidget( |
| 906 RenderWidgetHost* render_widget_host) { | 910 RenderWidgetHost* render_widget_host) { |
| 907 return new RenderWidgetHostViewAura(render_widget_host, false); | 911 return new RenderWidgetHostViewAura(render_widget_host, false); |
| 908 } | 912 } |
| 909 | 913 |
| 910 void WebContentsViewAura::SetPageTitle(const base::string16& title) { | 914 void WebContentsViewAura::SetPageTitle(const base::string16& title) { |
| 911 window_->SetTitle(title); | 915 window_->SetTitle(title); |
| 912 } | 916 } |
| 913 | 917 |
| 914 void WebContentsViewAura::RenderViewCreated(RenderViewHost* host) { | 918 void WebContentsViewAura::RenderViewCreated(RenderViewHost* host) { |
| 915 } | 919 } |
| 916 | 920 |
| 917 void WebContentsViewAura::RenderViewSwappedIn(RenderViewHost* host) { | 921 void WebContentsViewAura::RenderViewSwappedIn(RenderViewHost* host) { |
| 918 AttachTouchEditableToRenderView(); | |
| 919 } | 922 } |
| 920 | 923 |
| 921 void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) { | 924 void WebContentsViewAura::SetOverscrollControllerEnabled(bool enabled) { |
| 922 RenderWidgetHostViewAura* view = | 925 RenderWidgetHostViewAura* view = |
| 923 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); | 926 ToRenderWidgetHostViewAura(web_contents_->GetRenderWidgetHostView()); |
| 924 if (view) { | 927 if (view) { |
| 925 view->SetOverscrollControllerEnabled(enabled); | 928 view->SetOverscrollControllerEnabled(enabled); |
| 926 if (enabled) | 929 if (enabled) |
| 927 InstallOverscrollControllerDelegate(view); | 930 InstallOverscrollControllerDelegate(view); |
| 928 } | 931 } |
| 929 | 932 |
| 930 if (!enabled) { | 933 if (!enabled) { |
| 931 navigation_overlay_.reset(); | 934 navigation_overlay_.reset(); |
| 932 } else if (!navigation_overlay_) { | 935 } else if (!navigation_overlay_) { |
| 933 navigation_overlay_.reset( | 936 navigation_overlay_.reset( |
| 934 new OverscrollNavigationOverlay(web_contents_, window_.get())); | 937 new OverscrollNavigationOverlay(web_contents_, window_.get())); |
| 935 } | 938 } |
| 936 } | 939 } |
| 937 | 940 |
| 938 //////////////////////////////////////////////////////////////////////////////// | 941 //////////////////////////////////////////////////////////////////////////////// |
| 939 // WebContentsViewAura, RenderViewHostDelegateView implementation: | 942 // WebContentsViewAura, RenderViewHostDelegateView implementation: |
| 940 | 943 |
| 941 void WebContentsViewAura::ShowContextMenu(RenderFrameHost* render_frame_host, | 944 void WebContentsViewAura::ShowContextMenu(RenderFrameHost* render_frame_host, |
| 942 const ContextMenuParams& params) { | 945 const ContextMenuParams& params) { |
| 943 if (touch_editable_) { | 946 ui::TouchSelectionController* selection_controller = GetSelectionController(); |
| 944 touch_editable_->EndTouchEditing(false); | 947 if (selection_controller) |
| 945 } | 948 selection_controller->HideAndDisallowShowingAutomatically(); |
| 946 if (delegate_) { | 949 if (delegate_) { |
| 947 RenderWidgetHostViewAura* view = ToRenderWidgetHostViewAura( | 950 RenderWidgetHostViewAura* view = ToRenderWidgetHostViewAura( |
| 948 web_contents_->GetRenderWidgetHostView()); | 951 web_contents_->GetRenderWidgetHostView()); |
| 949 if (view) | 952 if (view) |
| 950 view->OnShowContextMenu(); | 953 view->OnShowContextMenu(); |
| 951 | 954 |
| 952 delegate_->ShowContextMenu(render_frame_host, params); | 955 delegate_->ShowContextMenu(render_frame_host, params); |
| 953 // WARNING: we may have been deleted during the call to ShowContextMenu(). | 956 // WARNING: we may have been deleted during the call to ShowContextMenu(). |
| 954 } | 957 } |
| 955 } | 958 } |
| 956 | 959 |
| 957 void WebContentsViewAura::StartDragging( | 960 void WebContentsViewAura::StartDragging( |
| 958 const DropData& drop_data, | 961 const DropData& drop_data, |
| 959 blink::WebDragOperationsMask operations, | 962 blink::WebDragOperationsMask operations, |
| 960 const gfx::ImageSkia& image, | 963 const gfx::ImageSkia& image, |
| 961 const gfx::Vector2d& image_offset, | 964 const gfx::Vector2d& image_offset, |
| 962 const DragEventSourceInfo& event_info) { | 965 const DragEventSourceInfo& event_info) { |
| 963 aura::Window* root_window = GetNativeView()->GetRootWindow(); | 966 aura::Window* root_window = GetNativeView()->GetRootWindow(); |
| 964 if (!aura::client::GetDragDropClient(root_window)) { | 967 if (!aura::client::GetDragDropClient(root_window)) { |
| 965 web_contents_->SystemDragEnded(); | 968 web_contents_->SystemDragEnded(); |
| 966 return; | 969 return; |
| 967 } | 970 } |
| 968 | 971 |
| 969 if (touch_editable_) | 972 ui::TouchSelectionController* selection_controller = GetSelectionController(); |
| 970 touch_editable_->EndTouchEditing(false); | 973 if (selection_controller) |
| 971 | 974 selection_controller->HideAndDisallowShowingAutomatically(); |
| 972 ui::OSExchangeData::Provider* provider = ui::OSExchangeData::CreateProvider(); | 975 ui::OSExchangeData::Provider* provider = ui::OSExchangeData::CreateProvider(); |
| 973 PrepareDragData(drop_data, provider, web_contents_); | 976 PrepareDragData(drop_data, provider, web_contents_); |
| 974 | 977 |
| 975 ui::OSExchangeData data(provider); // takes ownership of |provider|. | 978 ui::OSExchangeData data(provider); // takes ownership of |provider|. |
| 976 | 979 |
| 977 if (!image.isNull()) | 980 if (!image.isNull()) |
| 978 drag_utils::SetDragImageOnDataObject(image, image_offset, &data); | 981 drag_utils::SetDragImageOnDataObject(image, image_offset, &data); |
| 979 | 982 |
| 980 scoped_ptr<WebDragSourceAura> drag_source( | 983 scoped_ptr<WebDragSourceAura> drag_source( |
| 981 new WebDragSourceAura(GetNativeView(), web_contents_)); | 984 new WebDragSourceAura(GetNativeView(), web_contents_)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 web_contents_->GetDelegate()->OverscrollComplete(); | 1076 web_contents_->GetDelegate()->OverscrollComplete(); |
| 1074 } | 1077 } |
| 1075 CompleteOverscrollNavigation(mode); | 1078 CompleteOverscrollNavigation(mode); |
| 1076 } | 1079 } |
| 1077 | 1080 |
| 1078 void WebContentsViewAura::OnOverscrollModeChange(OverscrollMode old_mode, | 1081 void WebContentsViewAura::OnOverscrollModeChange(OverscrollMode old_mode, |
| 1079 OverscrollMode new_mode) { | 1082 OverscrollMode new_mode) { |
| 1080 if (old_mode == OVERSCROLL_NORTH || old_mode == OVERSCROLL_SOUTH) | 1083 if (old_mode == OVERSCROLL_NORTH || old_mode == OVERSCROLL_SOUTH) |
| 1081 OverscrollUpdateForWebContentsDelegate(0); | 1084 OverscrollUpdateForWebContentsDelegate(0); |
| 1082 | 1085 |
| 1083 if (touch_editable_) { | |
| 1084 if (new_mode == OVERSCROLL_NONE) | |
| 1085 touch_editable_->OverscrollCompleted(); | |
| 1086 else | |
| 1087 touch_editable_->OverscrollStarted(); | |
| 1088 } | |
| 1089 | |
| 1090 current_overscroll_gesture_ = new_mode; | 1086 current_overscroll_gesture_ = new_mode; |
| 1091 navigation_overlay_->relay_delegate()->OnOverscrollModeChange(old_mode, | 1087 navigation_overlay_->relay_delegate()->OnOverscrollModeChange(old_mode, |
| 1092 new_mode); | 1088 new_mode); |
| 1093 completed_overscroll_gesture_ = OVERSCROLL_NONE; | 1089 completed_overscroll_gesture_ = OVERSCROLL_NONE; |
| 1094 } | 1090 } |
| 1095 | 1091 |
| 1096 //////////////////////////////////////////////////////////////////////////////// | 1092 //////////////////////////////////////////////////////////////////////////////// |
| 1097 // WebContentsViewAura, aura::WindowDelegate implementation: | 1093 // WebContentsViewAura, aura::WindowDelegate implementation: |
| 1098 | 1094 |
| 1099 gfx::Size WebContentsViewAura::GetMinimumSize() const { | 1095 gfx::Size WebContentsViewAura::GetMinimumSize() const { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 if (visible) { | 1316 if (visible) { |
| 1321 if (!web_contents_->should_normally_be_visible()) | 1317 if (!web_contents_->should_normally_be_visible()) |
| 1322 web_contents_->WasShown(); | 1318 web_contents_->WasShown(); |
| 1323 } else { | 1319 } else { |
| 1324 if (web_contents_->should_normally_be_visible()) | 1320 if (web_contents_->should_normally_be_visible()) |
| 1325 web_contents_->WasHidden(); | 1321 web_contents_->WasHidden(); |
| 1326 } | 1322 } |
| 1327 } | 1323 } |
| 1328 | 1324 |
| 1329 } // namespace content | 1325 } // namespace content |
| OLD | NEW |