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

Unified Diff: ui/app_list/views/contents_view.cc

Issue 187083004: Change content view switching animation for experimental app launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares_hide_search_box
Patch Set: Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/contents_view.cc
diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc
index 1921aca0dc0872836b24e862c27610f887bd88ea..784f76b3d3833205086a443a5d3837093e3da999 100644
--- a/ui/app_list/views/contents_view.cc
+++ b/ui/app_list/views/contents_view.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "ui/app_list/app_list_constants.h"
+#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/pagination_model.h"
#include "ui/app_list/views/app_list_main_view.h"
@@ -109,6 +110,31 @@ void ContentsView::CalculateIdealBounds() {
if (rect.IsEmpty())
return;
+ if (app_list::switches::IsExperimentalAppListEnabled()) {
+ int incoming_view = 0;
tapted 2014/03/05 07:37:17 nit: incoming_view_index or incoming_index
calamity 2014/03/07 00:30:51 Done.
+ switch (show_state_) {
+ case SHOW_APPS:
+ incoming_view = kIndexAppsContainer;
+ break;
+ case SHOW_SEARCH_RESULTS:
+ incoming_view = kIndexSearchResults;
+ break;
+ default:
+ NOTREACHED();
+ }
+
+ gfx::Rect incoming_target(GetContentsBounds());
tapted 2014/03/05 07:37:17 nit: initialise these both with |rect|?
calamity 2014/03/07 00:30:51 Done.
+ gfx::Rect outgoing_target(GetContentsBounds());
+ outgoing_target.set_y(-outgoing_target.height());
+
+ for (int i = 0; i < view_model_->view_size(); ++i) {
+ views::View* view = view_model_->view_at(i);
tapted 2014/03/05 07:37:17 |view| unused?
calamity 2014/03/07 00:30:51 Done.
+ view_model_->set_ideal_bounds(i, i == incoming_view ? incoming_target
+ : outgoing_target);
+ }
+ return;
+ }
+
gfx::Rect container_frame(rect);
gfx::Rect results_frame(rect);
« 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