OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/scrollbar_animation_controller.h" | 10 #include "cc/animation/scrollbar_animation_controller.h" |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 scroll_offset_delegate_->GetTotalScrollOffset() - scroll_offset_; | 994 scroll_offset_delegate_->GetTotalScrollOffset() - scroll_offset_; |
995 } | 995 } |
996 gfx::Vector2dF total_offset = TotalScrollOffset(); | 996 gfx::Vector2dF total_offset = TotalScrollOffset(); |
997 scroll_offset_delegate_ = scroll_offset_delegate; | 997 scroll_offset_delegate_ = scroll_offset_delegate; |
998 if (scroll_offset_delegate_) { | 998 if (scroll_offset_delegate_) { |
999 scroll_offset_delegate_->SetMaxScrollOffset(max_scroll_offset_); | 999 scroll_offset_delegate_->SetMaxScrollOffset(max_scroll_offset_); |
1000 scroll_offset_delegate_->SetTotalScrollOffset(total_offset); | 1000 scroll_offset_delegate_->SetTotalScrollOffset(total_offset); |
1001 } | 1001 } |
1002 } | 1002 } |
1003 | 1003 |
1004 bool LayerImpl::IsExternalFlingActive() const { | |
1005 return scroll_offset_delegate_ && | |
1006 scroll_offset_delegate_->IsExternalFlingActive(); | |
1007 } | |
1008 | |
1009 void LayerImpl::SetScrollOffset(gfx::Vector2d scroll_offset) { | 1004 void LayerImpl::SetScrollOffset(gfx::Vector2d scroll_offset) { |
1010 SetScrollOffsetAndDelta(scroll_offset, ScrollDelta()); | 1005 SetScrollOffsetAndDelta(scroll_offset, ScrollDelta()); |
1011 } | 1006 } |
1012 | 1007 |
1013 void LayerImpl::SetScrollOffsetAndDelta(gfx::Vector2d scroll_offset, | 1008 void LayerImpl::SetScrollOffsetAndDelta(gfx::Vector2d scroll_offset, |
1014 gfx::Vector2dF scroll_delta) { | 1009 gfx::Vector2dF scroll_delta) { |
1015 bool changed = false; | 1010 bool changed = false; |
1016 | 1011 |
1017 if (scroll_offset_ != scroll_offset) { | 1012 if (scroll_offset_ != scroll_offset) { |
1018 changed = true; | 1013 changed = true; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1321 |
1327 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1322 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
1328 | 1323 |
1329 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1324 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1330 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1325 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1331 AsValueInto(state.get()); | 1326 AsValueInto(state.get()); |
1332 return state.PassAs<base::Value>(); | 1327 return state.PassAs<base::Value>(); |
1333 } | 1328 } |
1334 | 1329 |
1335 } // namespace cc | 1330 } // namespace cc |
OLD | NEW |