| 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 <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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 widget_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 512 widget_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 513 home_card_widget_->Init(widget_params); | 513 home_card_widget_->Init(widget_params); |
| 514 | 514 |
| 515 SetState(VISIBLE_MINIMIZED); | 515 SetState(VISIBLE_MINIMIZED); |
| 516 home_card_view_->Layout(); | 516 home_card_view_->Layout(); |
| 517 | 517 |
| 518 activation_client_ = | 518 activation_client_ = |
| 519 aura::client::GetActivationClient(container->GetRootWindow()); | 519 aura::client::GetActivationClient(container->GetRootWindow()); |
| 520 if (activation_client_) | 520 if (activation_client_) |
| 521 activation_client_->AddObserver(this); | 521 activation_client_->AddObserver(this); |
| 522 |
| 523 int work_area_bottom_inset = |
| 524 GetBoundsForState(GetNativeWindow()->bounds(), |
| 525 HomeCard::VISIBLE_MINIMIZED).height(); |
| 526 ScreenManager::Get()->SetWorkAreaInsets( |
| 527 gfx::Insets(0, 0, work_area_bottom_inset, 0)); |
| 522 } | 528 } |
| 523 | 529 |
| 524 void HomeCardImpl::InstallAccelerators() { | 530 void HomeCardImpl::InstallAccelerators() { |
| 525 const AcceleratorData accelerator_data[] = { | 531 const AcceleratorData accelerator_data[] = { |
| 526 {TRIGGER_ON_PRESS, ui::VKEY_L, ui::EF_CONTROL_DOWN, | 532 {TRIGGER_ON_PRESS, ui::VKEY_L, ui::EF_CONTROL_DOWN, |
| 527 COMMAND_SHOW_HOME_CARD, AF_NONE}, | 533 COMMAND_SHOW_HOME_CARD, AF_NONE}, |
| 528 }; | 534 }; |
| 529 AcceleratorManager::Get()->RegisterAccelerators( | 535 AcceleratorManager::Get()->RegisterAccelerators( |
| 530 accelerator_data, arraysize(accelerator_data), this); | 536 accelerator_data, arraysize(accelerator_data), this); |
| 531 } | 537 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 instance = NULL; | 659 instance = NULL; |
| 654 } | 660 } |
| 655 | 661 |
| 656 // static | 662 // static |
| 657 HomeCard* HomeCard::Get() { | 663 HomeCard* HomeCard::Get() { |
| 658 DCHECK(instance); | 664 DCHECK(instance); |
| 659 return instance; | 665 return instance; |
| 660 } | 666 } |
| 661 | 667 |
| 662 } // namespace athena | 668 } // namespace athena |
| OLD | NEW |