OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/aura/overscroll_window_animation.h" | 5 #include "content/browser/web_contents/aura/overscroll_window_animation.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 ? -slide_window_bounds.width() | 114 ? -slide_window_bounds.width() |
115 : slide_window_bounds.width(), | 115 : slide_window_bounds.width(), |
116 0); | 116 0); |
117 } else { | 117 } else { |
118 slide_window_bounds.Offset(base::i18n::IsRTL() | 118 slide_window_bounds.Offset(base::i18n::IsRTL() |
119 ? slide_window_bounds.width() / 2 | 119 ? slide_window_bounds.width() / 2 |
120 : -slide_window_bounds.width() / 2, | 120 : -slide_window_bounds.width() / 2, |
121 0); | 121 0); |
122 } | 122 } |
123 | 123 |
124 DCHECK_EQ(overscroll_source_, OverscrollSource::NONE); | |
mohsen
2017/07/20 17:22:37
Do you mean that this is not always true? If yes,
mfomitchev
2017/07/20 17:28:09
See the CL that I linked in the description. Basic
mohsen
2017/07/20 18:14:26
Opps! Sorry, I missed the CL in the description!
| |
125 overscroll_source_ = source; | 124 overscroll_source_ = source; |
126 slide_window_ = new_direction == SLIDE_FRONT | 125 slide_window_ = new_direction == SLIDE_FRONT |
127 ? delegate_->CreateFrontWindow(slide_window_bounds) | 126 ? delegate_->CreateFrontWindow(slide_window_bounds) |
128 : delegate_->CreateBackWindow(slide_window_bounds); | 127 : delegate_->CreateBackWindow(slide_window_bounds); |
129 if (!slide_window_) { | 128 if (!slide_window_) { |
130 // Cannot navigate, do not start an overscroll gesture. | 129 // Cannot navigate, do not start an overscroll gesture. |
131 direction_ = SLIDE_NONE; | 130 direction_ = SLIDE_NONE; |
132 overscroll_source_ = OverscrollSource::NONE; | 131 overscroll_source_ = OverscrollSource::NONE; |
133 return; | 132 return; |
134 } | 133 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 ui::Layer* OverscrollWindowAnimation::GetBackLayer() const { | 185 ui::Layer* OverscrollWindowAnimation::GetBackLayer() const { |
187 DCHECK(direction_ != SLIDE_NONE); | 186 DCHECK(direction_ != SLIDE_NONE); |
188 if (direction_ == SLIDE_BACK) { | 187 if (direction_ == SLIDE_BACK) { |
189 DCHECK(slide_window_); | 188 DCHECK(slide_window_); |
190 return slide_window_->layer(); | 189 return slide_window_->layer(); |
191 } | 190 } |
192 return delegate_->GetMainWindow()->layer(); | 191 return delegate_->GetMainWindow()->layer(); |
193 } | 192 } |
194 | 193 |
195 } // namespace content | 194 } // namespace content |
OLD | NEW |