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

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 23531053: ui/base/animation -> ui/gfx/animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 7 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/web_contents/aura/window_slider.cc ('k') | ui/app_list/pagination_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 void WebContentsViewAura::ResetOverscrollTransform() { 928 void WebContentsViewAura::ResetOverscrollTransform() {
929 if (!web_contents_->GetRenderWidgetHostView()) 929 if (!web_contents_->GetRenderWidgetHostView())
930 return; 930 return;
931 aura::Window* target = GetWindowToAnimateForOverscroll(); 931 aura::Window* target = GetWindowToAnimateForOverscroll();
932 if (!target) 932 if (!target)
933 return; 933 return;
934 { 934 {
935 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator()); 935 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator());
936 settings.SetPreemptionStrategy( 936 settings.SetPreemptionStrategy(
937 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 937 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
938 settings.SetTweenType(ui::Tween::EASE_OUT); 938 settings.SetTweenType(gfx::Tween::EASE_OUT);
939 settings.AddObserver(this); 939 settings.AddObserver(this);
940 target->SetTransform(gfx::Transform()); 940 target->SetTransform(gfx::Transform());
941 } 941 }
942 { 942 {
943 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator()); 943 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator());
944 settings.SetPreemptionStrategy( 944 settings.SetPreemptionStrategy(
945 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 945 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
946 settings.SetTweenType(ui::Tween::EASE_OUT); 946 settings.SetTweenType(gfx::Tween::EASE_OUT);
947 UpdateOverscrollWindowBrightness(0.f); 947 UpdateOverscrollWindowBrightness(0.f);
948 } 948 }
949 } 949 }
950 950
951 void WebContentsViewAura::CompleteOverscrollNavigation(OverscrollMode mode) { 951 void WebContentsViewAura::CompleteOverscrollNavigation(OverscrollMode mode) {
952 if (!web_contents_->GetRenderWidgetHostView()) 952 if (!web_contents_->GetRenderWidgetHostView())
953 return; 953 return;
954 954
955 // Animate out the current view first. Navigate to the requested history at 955 // Animate out the current view first. Navigate to the requested history at
956 // the end of the animation. 956 // the end of the animation.
957 if (current_overscroll_gesture_ == OVERSCROLL_NONE) 957 if (current_overscroll_gesture_ == OVERSCROLL_NONE)
958 return; 958 return;
959 959
960 UMA_HISTOGRAM_ENUMERATION("Overscroll.Navigated", 960 UMA_HISTOGRAM_ENUMERATION("Overscroll.Navigated",
961 current_overscroll_gesture_, OVERSCROLL_COUNT); 961 current_overscroll_gesture_, OVERSCROLL_COUNT);
962 OverscrollWindowDelegate* delegate = static_cast<OverscrollWindowDelegate*>( 962 OverscrollWindowDelegate* delegate = static_cast<OverscrollWindowDelegate*>(
963 overscroll_window_->delegate()); 963 overscroll_window_->delegate());
964 delegate->stop_forwarding_events(); 964 delegate->stop_forwarding_events();
965 965
966 completed_overscroll_gesture_ = mode; 966 completed_overscroll_gesture_ = mode;
967 aura::Window* target = GetWindowToAnimateForOverscroll(); 967 aura::Window* target = GetWindowToAnimateForOverscroll();
968 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator()); 968 ui::ScopedLayerAnimationSettings settings(target->layer()->GetAnimator());
969 settings.SetPreemptionStrategy( 969 settings.SetPreemptionStrategy(
970 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 970 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
971 settings.SetTweenType(ui::Tween::EASE_OUT); 971 settings.SetTweenType(gfx::Tween::EASE_OUT);
972 settings.AddObserver(this); 972 settings.AddObserver(this);
973 gfx::Transform transform; 973 gfx::Transform transform;
974 int content_width = 974 int content_width =
975 web_contents_->GetRenderWidgetHostView()->GetViewBounds().width(); 975 web_contents_->GetRenderWidgetHostView()->GetViewBounds().width();
976 int translate_x = mode == OVERSCROLL_WEST ? -content_width : content_width; 976 int translate_x = mode == OVERSCROLL_WEST ? -content_width : content_width;
977 transform.Translate(translate_x, 0); 977 transform.Translate(translate_x, 0);
978 target->SetTransform(transform); 978 target->SetTransform(transform);
979 UpdateOverscrollWindowBrightness(translate_x); 979 UpdateOverscrollWindowBrightness(translate_x);
980 } 980 }
981 981
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 event.location(), 1630 event.location(),
1631 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), 1631 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
1632 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); 1632 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
1633 if (drag_dest_delegate_) 1633 if (drag_dest_delegate_)
1634 drag_dest_delegate_->OnDrop(); 1634 drag_dest_delegate_->OnDrop();
1635 current_drop_data_.reset(); 1635 current_drop_data_.reset();
1636 return current_drag_op_; 1636 return current_drag_op_;
1637 } 1637 }
1638 1638
1639 } // namespace content 1639 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/aura/window_slider.cc ('k') | ui/app_list/pagination_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698