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

Unified Diff: athena/home/home_card_impl.cc

Issue 529813002: Simplify HomeCardGestureManager::UpdateScrollState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: athena/home/home_card_impl.cc
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index 0066cf3d3be8e000d6fe2972df30c5e20fa8b190..80b96b1d0b2d9f10fcb0330250421af0f664e7ed 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -157,10 +157,8 @@ class HomeCardView : public views::WidgetDelegateView {
HomeCard::State to_state,
float progress) {
// TODO(mukai): not clear the focus, but simply close the virtual keyboard.
- if (from_state != HomeCard::VISIBLE_CENTERED ||
- to_state != HomeCard::VISIBLE_CENTERED) {
- GetFocusManager()->ClearFocus();
- }
+ GetFocusManager()->ClearFocus();
Jun Mukai 2014/09/02 03:51:42 Not sure why how this change is related to the bug
pkotwicz 2014/09/02 04:41:32 This change is related to this CL given that if |f
Jun Mukai 2014/09/02 08:22:42 Hmm, that sounds a bug then. In case the user drag
+
if (from_state == HomeCard::VISIBLE_CENTERED)
main_view_->SetLayoutState(1.0f - progress);
else if (to_state == HomeCard::VISIBLE_CENTERED)
@@ -402,8 +400,9 @@ void HomeCardImpl::OnGestureProgressed(
State from_state, State to_state, float progress) {
if (from_state == VISIBLE_MINIMIZED || to_state == VISIBLE_MINIMIZED) {
minimized_home_->layer()->SetVisible(true);
- float opacity =
- (from_state == VISIBLE_MINIMIZED) ? 1.0f - progress : progress;
+ float opacity = 1.0f;
+ if (from_state != to_state)
+ opacity = (from_state == VISIBLE_MINIMIZED) ? 1.0f - progress : progress;
Jun Mukai 2014/09/02 03:51:42 Can you fix home_card_gesture_manager side in this
pkotwicz 2014/09/02 04:41:32 I have now fixed this in home_card_gesture_manager
minimized_home_->layer()->SetOpacity(opacity);
}
gfx::Rect screen_bounds =
« athena/home/home_card_gesture_manager.h ('K') | « athena/home/home_card_gesture_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698