Commit 19e54792 authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

App_list: Update Search Result Page View's OnBoundsChanged to reset rect based...

App_list: Update Search Result Page View's OnBoundsChanged to reset rect based on size instead of size and origin.

Bug: 1010724
Change-Id: Ic6061f243942a5c1d835f0df002321ee46fba78a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841574
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703498}
parent 8155c88c
......@@ -268,10 +268,11 @@ gfx::Size SearchResultPageView::CalculatePreferredSize() const {
}
void SearchResultPageView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
// This bounds change is produced by search result movement (rotation, etc)
// and all content has to follow.
if (previous_bounds != GetContentsBounds())
layer()->SetClipRect(GetContentsBounds());
// The clip rect set for page state animations needs to be reset when the
// bounds change because page size change invalidates the previous bounds.
// This allows content to properly follow target bounds when screen rotates.
if (previous_bounds.size() != bounds().size())
layer()->SetClipRect(gfx::Rect());
}
void SearchResultPageView::ReorderSearchResultContainers() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment