| 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/env/public/athena_env.h" | 10 #include "athena/env/public/athena_env.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 352 } |
| 353 | 353 |
| 354 bool HomeCardImpl::IsCommandEnabled(int command_id) const { | 354 bool HomeCardImpl::IsCommandEnabled(int command_id) const { |
| 355 return true; | 355 return true; |
| 356 } | 356 } |
| 357 | 357 |
| 358 bool HomeCardImpl::OnAcceleratorFired(int command_id, | 358 bool HomeCardImpl::OnAcceleratorFired(int command_id, |
| 359 const ui::Accelerator& accelerator) { | 359 const ui::Accelerator& accelerator) { |
| 360 DCHECK_EQ(COMMAND_SHOW_HOME_CARD, command_id); | 360 DCHECK_EQ(COMMAND_SHOW_HOME_CARD, command_id); |
| 361 | 361 |
| 362 if (state_ == VISIBLE_CENTERED && original_state_ != VISIBLE_BOTTOM) | 362 if (state_ == VISIBLE_CENTERED && original_state_ != VISIBLE_BOTTOM) { |
| 363 SetState(VISIBLE_MINIMIZED); | 363 SetState(VISIBLE_MINIMIZED); |
| 364 else if (state_ == VISIBLE_MINIMIZED) | 364 WindowManager::Get()->ExitOverview(); |
| 365 } else if (state_ == VISIBLE_MINIMIZED) { |
| 365 SetState(VISIBLE_CENTERED); | 366 SetState(VISIBLE_CENTERED); |
| 367 WindowManager::Get()->EnterOverview(); |
| 368 } |
| 366 return true; | 369 return true; |
| 367 } | 370 } |
| 368 | 371 |
| 369 void HomeCardImpl::OnGestureEnded(State final_state, bool is_fling) { | 372 void HomeCardImpl::OnGestureEnded(State final_state, bool is_fling) { |
| 370 home_card_view_->ClearGesture(); | 373 home_card_view_->ClearGesture(); |
| 371 if (state_ != final_state && | 374 if (state_ != final_state && |
| 372 (state_ == VISIBLE_MINIMIZED || final_state == VISIBLE_MINIMIZED)) { | 375 (state_ == VISIBLE_MINIMIZED || final_state == VISIBLE_MINIMIZED)) { |
| 373 SetState(final_state); | 376 SetState(final_state); |
| 374 if (WindowManager::Get()->IsOverviewModeActive()) | 377 if (WindowManager::Get()->IsOverviewModeActive()) |
| 375 WindowManager::Get()->ExitOverview(); | 378 WindowManager::Get()->ExitOverview(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 instance = NULL; | 449 instance = NULL; |
| 447 } | 450 } |
| 448 | 451 |
| 449 // static | 452 // static |
| 450 HomeCard* HomeCard::Get() { | 453 HomeCard* HomeCard::Get() { |
| 451 DCHECK(instance); | 454 DCHECK(instance); |
| 452 return instance; | 455 return instance; |
| 453 } | 456 } |
| 454 | 457 |
| 455 } // namespace athena | 458 } // namespace athena |
| OLD | NEW |