| 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/home/app_list_view_delegate.h" | 10 #include "athena/home/app_list_view_delegate.h" |
| 10 #include "athena/home/bottom_home_view.h" | 11 #include "athena/home/bottom_home_view.h" |
| 11 #include "athena/home/minimized_home.h" | 12 #include "athena/home/minimized_home.h" |
| 12 #include "athena/home/public/app_model_builder.h" | 13 #include "athena/home/public/app_model_builder.h" |
| 13 #include "athena/input/public/accelerator_manager.h" | 14 #include "athena/input/public/accelerator_manager.h" |
| 14 #include "athena/screen/public/screen_manager.h" | 15 #include "athena/screen/public/screen_manager.h" |
| 15 #include "athena/wm/public/window_manager.h" | 16 #include "athena/wm/public/window_manager.h" |
| 16 #include "athena/wm/public/window_manager_observer.h" | 17 #include "athena/wm/public/window_manager_observer.h" |
| 17 #include "base/bind.h" | 18 #include "base/bind.h" |
| 18 #include "ui/app_list/search_provider.h" | 19 #include "ui/app_list/search_provider.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } else if (state_ == VISIBLE_BOTTOM && !bounds.IsEmpty()) { | 323 } else if (state_ == VISIBLE_BOTTOM && !bounds.IsEmpty()) { |
| 323 SetState(VISIBLE_CENTERED); | 324 SetState(VISIBLE_CENTERED); |
| 324 original_state_ = VISIBLE_BOTTOM; | 325 original_state_ = VISIBLE_BOTTOM; |
| 325 } else if (state_ != original_state_ && bounds.IsEmpty()) { | 326 } else if (state_ != original_state_ && bounds.IsEmpty()) { |
| 326 SetState(original_state_); | 327 SetState(original_state_); |
| 327 } | 328 } |
| 328 } | 329 } |
| 329 | 330 |
| 330 void HomeCardImpl::Init() { | 331 void HomeCardImpl::Init() { |
| 331 InstallAccelerators(); | 332 InstallAccelerators(); |
| 332 ScreenManager::ContainerParams params("HomeCardContainer"); | 333 ScreenManager::ContainerParams params("HomeCardContainer", CP_HOME_CARD); |
| 333 params.can_activate_children = true; | 334 params.can_activate_children = true; |
| 334 aura::Window* container = ScreenManager::Get()->CreateContainer(params); | 335 aura::Window* container = ScreenManager::Get()->CreateContainer(params); |
| 335 layout_manager_ = new HomeCardLayoutManager(this); | 336 layout_manager_ = new HomeCardLayoutManager(this); |
| 336 | 337 |
| 337 container->SetLayoutManager(layout_manager_); | 338 container->SetLayoutManager(layout_manager_); |
| 338 wm::SetChildWindowVisibilityChangesAnimated(container); | 339 wm::SetChildWindowVisibilityChangesAnimated(container); |
| 339 | 340 |
| 340 view_delegate_.reset(new AppListViewDelegate(model_builder_.get())); | 341 view_delegate_.reset(new AppListViewDelegate(model_builder_.get())); |
| 341 if (search_provider_) | 342 if (search_provider_) |
| 342 view_delegate_->RegisterSearchProvider(search_provider_.get()); | 343 view_delegate_->RegisterSearchProvider(search_provider_.get()); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 instance = NULL; | 385 instance = NULL; |
| 385 } | 386 } |
| 386 | 387 |
| 387 // static | 388 // static |
| 388 HomeCard* HomeCard::Get() { | 389 HomeCard* HomeCard::Get() { |
| 389 DCHECK(instance); | 390 DCHECK(instance); |
| 390 return instance; | 391 return instance; |
| 391 } | 392 } |
| 392 | 393 |
| 393 } // namespace athena | 394 } // namespace athena |
| OLD | NEW |