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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 widget_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 453 widget_params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
454 home_card_widget_->Init(widget_params); | 454 home_card_widget_->Init(widget_params); |
455 | 455 |
456 SetState(VISIBLE_MINIMIZED); | 456 SetState(VISIBLE_MINIMIZED); |
457 home_card_view_->Layout(); | 457 home_card_view_->Layout(); |
458 | 458 |
459 activation_client_ = | 459 activation_client_ = |
460 aura::client::GetActivationClient(container->GetRootWindow()); | 460 aura::client::GetActivationClient(container->GetRootWindow()); |
461 if (activation_client_) | 461 if (activation_client_) |
462 activation_client_->AddObserver(this); | 462 activation_client_->AddObserver(this); |
| 463 |
| 464 int work_area_bottom_inset = |
| 465 GetBoundsForState(GetNativeWindow()->bounds(), |
| 466 HomeCard::VISIBLE_MINIMIZED).height(); |
| 467 ScreenManager::Get()->SetWorkAreaInsets( |
| 468 gfx::Insets(0, 0, work_area_bottom_inset, 0)); |
463 } | 469 } |
464 | 470 |
465 void HomeCardImpl::InstallAccelerators() { | 471 void HomeCardImpl::InstallAccelerators() { |
466 const AcceleratorData accelerator_data[] = { | 472 const AcceleratorData accelerator_data[] = { |
467 {TRIGGER_ON_PRESS, ui::VKEY_L, ui::EF_CONTROL_DOWN, | 473 {TRIGGER_ON_PRESS, ui::VKEY_L, ui::EF_CONTROL_DOWN, |
468 COMMAND_SHOW_HOME_CARD, AF_NONE}, | 474 COMMAND_SHOW_HOME_CARD, AF_NONE}, |
469 }; | 475 }; |
470 AcceleratorManager::Get()->RegisterAccelerators( | 476 AcceleratorManager::Get()->RegisterAccelerators( |
471 accelerator_data, arraysize(accelerator_data), this); | 477 accelerator_data, arraysize(accelerator_data), this); |
472 } | 478 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 instance = NULL; | 600 instance = NULL; |
595 } | 601 } |
596 | 602 |
597 // static | 603 // static |
598 HomeCard* HomeCard::Get() { | 604 HomeCard* HomeCard::Get() { |
599 DCHECK(instance); | 605 DCHECK(instance); |
600 return instance; | 606 return instance; |
601 } | 607 } |
602 | 608 |
603 } // namespace athena | 609 } // namespace athena |
OLD | NEW |