| 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" |
| 11 #include "athena/env/public/athena_env.h" |
| 11 #include "athena/home/app_list_view_delegate.h" | 12 #include "athena/home/app_list_view_delegate.h" |
| 12 #include "athena/home/athena_start_page_view.h" | 13 #include "athena/home/athena_start_page_view.h" |
| 13 #include "athena/home/minimized_home.h" | 14 #include "athena/home/minimized_home.h" |
| 14 #include "athena/home/public/app_model_builder.h" | 15 #include "athena/home/public/app_model_builder.h" |
| 15 #include "athena/input/public/accelerator_manager.h" | 16 #include "athena/input/public/accelerator_manager.h" |
| 16 #include "athena/screen/public/screen_manager.h" | 17 #include "athena/screen/public/screen_manager.h" |
| 17 #include "athena/wm/public/window_manager.h" | 18 #include "athena/wm/public/window_manager.h" |
| 18 #include "athena/wm/public/window_manager_observer.h" | 19 #include "athena/wm/public/window_manager_observer.h" |
| 19 #include "base/bind.h" | 20 #include "base/bind.h" |
| 20 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 home_card_view_->Layout(); | 520 home_card_view_->Layout(); |
| 520 | 521 |
| 521 activation_client_ = | 522 activation_client_ = |
| 522 aura::client::GetActivationClient(container->GetRootWindow()); | 523 aura::client::GetActivationClient(container->GetRootWindow()); |
| 523 if (activation_client_) | 524 if (activation_client_) |
| 524 activation_client_->AddObserver(this); | 525 activation_client_->AddObserver(this); |
| 525 | 526 |
| 526 int work_area_bottom_inset = | 527 int work_area_bottom_inset = |
| 527 GetBoundsForState(GetNativeWindow()->bounds(), | 528 GetBoundsForState(GetNativeWindow()->bounds(), |
| 528 HomeCard::VISIBLE_MINIMIZED).height(); | 529 HomeCard::VISIBLE_MINIMIZED).height(); |
| 529 ScreenManager::Get()->SetWorkAreaInsets( | 530 AthenaEnv::Get()->SetDisplayWorkAreaInsets( |
| 530 gfx::Insets(0, 0, work_area_bottom_inset, 0)); | 531 gfx::Insets(0, 0, work_area_bottom_inset, 0)); |
| 531 } | 532 } |
| 532 | 533 |
| 533 void HomeCardImpl::InstallAccelerators() { | 534 void HomeCardImpl::InstallAccelerators() { |
| 534 const AcceleratorData accelerator_data[] = { | 535 const AcceleratorData accelerator_data[] = { |
| 535 {TRIGGER_ON_PRESS, ui::VKEY_L, ui::EF_CONTROL_DOWN, | 536 {TRIGGER_ON_PRESS, ui::VKEY_L, ui::EF_CONTROL_DOWN, |
| 536 COMMAND_SHOW_HOME_CARD, AF_NONE}, | 537 COMMAND_SHOW_HOME_CARD, AF_NONE}, |
| 537 }; | 538 }; |
| 538 AcceleratorManager::Get()->RegisterAccelerators( | 539 AcceleratorManager::Get()->RegisterAccelerators( |
| 539 accelerator_data, arraysize(accelerator_data), this); | 540 accelerator_data, arraysize(accelerator_data), this); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 instance = NULL; | 663 instance = NULL; |
| 663 } | 664 } |
| 664 | 665 |
| 665 // static | 666 // static |
| 666 HomeCard* HomeCard::Get() { | 667 HomeCard* HomeCard::Get() { |
| 667 DCHECK(instance); | 668 DCHECK(instance); |
| 668 return instance; | 669 return instance; |
| 669 } | 670 } |
| 670 | 671 |
| 671 } // namespace athena | 672 } // namespace athena |
| OLD | NEW |