OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |