| 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/public/home_card.h" | 5 #include "athena/home/public/home_card.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "athena/common/container_priorities.h" | 9 #include "athena/common/container_priorities.h" |
| 10 #include "athena/home/app_list_view_delegate.h" | 10 #include "athena/home/app_list_view_delegate.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 if (state_ == state) | 294 if (state_ == state) |
| 295 return; | 295 return; |
| 296 | 296 |
| 297 // Update |state_| before changing the visibility of the widgets, so that | 297 // Update |state_| before changing the visibility of the widgets, so that |
| 298 // LayoutManager callbacks get the correct state. | 298 // LayoutManager callbacks get the correct state. |
| 299 state_ = state; | 299 state_ = state; |
| 300 original_state_ = state; | 300 original_state_ = state; |
| 301 if (state_ == HIDDEN) { | 301 if (state_ == HIDDEN) { |
| 302 home_card_widget_->Hide(); | 302 home_card_widget_->Hide(); |
| 303 } else { | 303 } else { |
| 304 home_card_widget_->Show(); | 304 if (state_ == VISIBLE_CENTERED) |
| 305 home_card_widget_->Show(); |
| 306 else |
| 307 home_card_widget_->ShowInactive(); |
| 305 home_card_view_->SetState(state); | 308 home_card_view_->SetState(state); |
| 306 layout_manager_->Layout(); | 309 layout_manager_->Layout(); |
| 307 } | 310 } |
| 308 } | 311 } |
| 309 | 312 |
| 310 HomeCard::State HomeCardImpl::GetState() { | 313 HomeCard::State HomeCardImpl::GetState() { |
| 311 return state_; | 314 return state_; |
| 312 } | 315 } |
| 313 | 316 |
| 314 void HomeCardImpl::RegisterSearchProvider( | 317 void HomeCardImpl::RegisterSearchProvider( |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 instance = NULL; | 391 instance = NULL; |
| 389 } | 392 } |
| 390 | 393 |
| 391 // static | 394 // static |
| 392 HomeCard* HomeCard::Get() { | 395 HomeCard* HomeCard::Get() { |
| 393 DCHECK(instance); | 396 DCHECK(instance); |
| 394 return instance; | 397 return instance; |
| 395 } | 398 } |
| 396 | 399 |
| 397 } // namespace athena | 400 } // namespace athena |
| OLD | NEW |