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

Side by Side Diff: ui/app_list/views/contents_animator.cc

Issue 781833005: Make SearchResultPageView animation clip to its onscreen bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_overlay_one
Patch Set: Created 6 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/app_list/views/contents_animator.h" 5 #include "ui/app_list/views/contents_animator.h"
6 6
7 #include "ui/app_list/app_list_constants.h" 7 #include "ui/app_list/app_list_constants.h"
8 #include "ui/app_list/app_list_switches.h" 8 #include "ui/app_list/app_list_switches.h"
9 #include "ui/app_list/views/app_list_main_view.h" 9 #include "ui/app_list/views/app_list_main_view.h"
10 #include "ui/app_list/views/contents_view.h" 10 #include "ui/app_list/views/contents_view.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 gfx::Rect from_page_origin(GetOffscreenPageBounds(from_page)); 118 gfx::Rect from_page_origin(GetOffscreenPageBounds(from_page));
119 gfx::Rect to_page_origin(GetOffscreenPageBounds(to_page)); 119 gfx::Rect to_page_origin(GetOffscreenPageBounds(to_page));
120 gfx::Rect from_page_rect(gfx::Tween::RectValueBetween( 120 gfx::Rect from_page_rect(gfx::Tween::RectValueBetween(
121 progress, from_page_onscreen, from_page_origin)); 121 progress, from_page_onscreen, from_page_origin));
122 gfx::Rect to_page_rect( 122 gfx::Rect to_page_rect(
123 gfx::Tween::RectValueBetween(progress, to_page_origin, to_page_onscreen)); 123 gfx::Tween::RectValueBetween(progress, to_page_origin, to_page_onscreen));
124 124
125 contents_view()->GetPageView(from_page)->SetBoundsRect(from_page_rect); 125 contents_view()->GetPageView(from_page)->SetBoundsRect(from_page_rect);
126 contents_view()->GetPageView(to_page)->SetBoundsRect(to_page_rect); 126 contents_view()->GetPageView(to_page)->SetBoundsRect(to_page_rect);
127 127
128 // Clip the search view to its target bounds.
129 int search_results_index =
130 contents_view()->GetPageIndexForState(AppListModel::STATE_SEARCH_RESULTS);
Matt Giuca 2014/12/09 07:34:18 This doesn't do what the CL description says, whic
calamity 2014/12/10 05:23:10 Oopz. Yeah, I changed it. It looked bad when the s
131 if (from_page == search_results_index) {
132 contents_view()->GetPageView(from_page)->set_clip_insets(
133 from_page_rect.InsetsFrom(from_page_onscreen));
134 }
135 if (to_page == search_results_index) {
136 contents_view()->GetPageView(to_page)->set_clip_insets(
137 to_page_rect.InsetsFrom(to_page_onscreen));
138 }
139
128 UpdateCustomPageForDefaultAnimation(progress, from_page, to_page); 140 UpdateCustomPageForDefaultAnimation(progress, from_page, to_page);
129 UpdateSearchBoxForDefaultAnimation(progress, from_page, to_page); 141 UpdateSearchBoxForDefaultAnimation(progress, from_page, to_page);
130 } 142 }
131 143
132 // StartToAppsAnimator 144 // StartToAppsAnimator
133 145
134 StartToAppsAnimator::StartToAppsAnimator(ContentsView* contents_view) 146 StartToAppsAnimator::StartToAppsAnimator(ContentsView* contents_view)
135 : ContentsAnimator(contents_view) { 147 : ContentsAnimator(contents_view) {
136 } 148 }
137 149
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 gfx::Rect custom_page_rect(gfx::Tween::RectValueBetween( 193 gfx::Rect custom_page_rect(gfx::Tween::RectValueBetween(
182 progress, custom_page_origin, custom_page_on_screen)); 194 progress, custom_page_origin, custom_page_on_screen));
183 195
184 contents_view()->GetPageView(start_page)->SetBoundsRect(start_page_rect); 196 contents_view()->GetPageView(start_page)->SetBoundsRect(start_page_rect);
185 contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect); 197 contents_view()->GetPageView(custom_page)->SetBoundsRect(custom_page_rect);
186 198
187 UpdateSearchBoxForDefaultAnimation(progress, start_page, custom_page); 199 UpdateSearchBoxForDefaultAnimation(progress, start_page, custom_page);
188 } 200 }
189 201
190 } // namespace app_list 202 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698