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

Side by Side Diff: athena/home/home_card_impl.cc

Issue 557083002: Relayout to the bottom state even when animating to minimized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 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 "athena/home/home_card_impl.h" 5 #include "athena/home/home_card_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "athena/common/container_priorities.h" 10 #include "athena/common/container_priorities.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 UpdateShadow(true); 165 UpdateShadow(true);
166 } 166 }
167 167
168 void SetStateWithAnimation(HomeCard::State state) { 168 void SetStateWithAnimation(HomeCard::State state) {
169 UpdateShadow(state != HomeCard::VISIBLE_MINIMIZED); 169 UpdateShadow(state != HomeCard::VISIBLE_MINIMIZED);
170 if (state == HomeCard::VISIBLE_CENTERED) 170 if (state == HomeCard::VISIBLE_CENTERED)
171 main_view_->RequestFocusOnSearchBox(); 171 main_view_->RequestFocusOnSearchBox();
172 else 172 else
173 GetWidget()->GetFocusManager()->ClearFocus(); 173 GetWidget()->GetFocusManager()->ClearFocus();
174 174
175 if (state == HomeCard::VISIBLE_MINIMIZED)
176 return;
177
178 main_view_->SetLayoutStateWithAnimation( 175 main_view_->SetLayoutStateWithAnimation(
179 (state == HomeCard::VISIBLE_CENTERED) ? 1.0f : 0.0f); 176 (state == HomeCard::VISIBLE_CENTERED) ? 1.0f : 0.0f);
180 } 177 }
181 178
182 void ClearGesture() { 179 void ClearGesture() {
183 gesture_manager_.reset(); 180 gesture_manager_.reset();
184 } 181 }
185 182
186 // views::View: 183 // views::View:
187 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { 184 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 instance = NULL; 443 instance = NULL;
447 } 444 }
448 445
449 // static 446 // static
450 HomeCard* HomeCard::Get() { 447 HomeCard* HomeCard::Get() {
451 DCHECK(instance); 448 DCHECK(instance);
452 return instance; 449 return instance;
453 } 450 }
454 451
455 } // namespace athena 452 } // namespace athena
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