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

Side by Side Diff: ui/compositor/layer.cc

Issue 2194833002: Overscroll and Elasticity for views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-RouteThroughInputHandler
Patch Set: Restore functionality and fix bugs \o/ Created 4 years, 1 month 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
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/overscroll/ui_input_handler.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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 826
827 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { 827 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) {
828 DCHECK(surface_layer_.get()); 828 DCHECK(surface_layer_.get());
829 if (delegate_) 829 if (delegate_)
830 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip); 830 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip);
831 } 831 }
832 832
833 void Layer::SetScrollable(Layer* parent_clip_layer, 833 void Layer::SetScrollable(Layer* parent_clip_layer,
834 const base::Closure& on_scroll) { 834 const base::Closure& on_scroll) {
835 cc_layer_->SetScrollClipLayerId(parent_clip_layer->cc_layer_->id()); 835 cc_layer_->SetScrollClipAndCanOverscroll(parent_clip_layer->cc_layer_->id(),
836 true /* can_overscroll */);
836 cc_layer_->set_did_scroll_callback(on_scroll); 837 cc_layer_->set_did_scroll_callback(on_scroll);
837 cc_layer_->SetUserScrollable(true, true); 838 cc_layer_->SetUserScrollable(true, true);
838 } 839 }
839 840
840 cc::ElementId Layer::GetElementId() const { 841 cc::ElementId Layer::GetElementId() const {
841 return cc_layer_->element_id(); 842 return cc_layer_->element_id();
842 } 843 }
843 844
844 gfx::ScrollOffset Layer::CurrentScrollOffset() const { 845 gfx::ScrollOffset Layer::CurrentScrollOffset() const {
845 const Compositor* compositor = GetCompositor(); 846 const Compositor* compositor = GetCompositor();
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1177 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1177 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1178 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1178 return mirror_ptr.get() == mirror; 1179 return mirror_ptr.get() == mirror;
1179 }); 1180 });
1180 1181
1181 DCHECK(it != mirrors_.end()); 1182 DCHECK(it != mirrors_.end());
1182 mirrors_.erase(it); 1183 mirrors_.erase(it);
1183 } 1184 }
1184 1185
1185 } // namespace ui 1186 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/BUILD.gn ('k') | ui/compositor/overscroll/ui_input_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698