| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 } else if (state_ == VISIBLE_BOTTOM && !bounds.IsEmpty()) { | 301 } else if (state_ == VISIBLE_BOTTOM && !bounds.IsEmpty()) { |
| 301 SetState(VISIBLE_CENTERED); | 302 SetState(VISIBLE_CENTERED); |
| 302 original_state_ = VISIBLE_BOTTOM; | 303 original_state_ = VISIBLE_BOTTOM; |
| 303 } else if (state_ != original_state_ && bounds.IsEmpty()) { | 304 } else if (state_ != original_state_ && bounds.IsEmpty()) { |
| 304 SetState(original_state_); | 305 SetState(original_state_); |
| 305 } | 306 } |
| 306 } | 307 } |
| 307 | 308 |
| 308 void HomeCardImpl::Init() { | 309 void HomeCardImpl::Init() { |
| 309 InstallAccelerators(); | 310 InstallAccelerators(); |
| 310 ScreenManager::ContainerParams params("HomeCardContainer"); | 311 ScreenManager::ContainerParams params("HomeCardContainer", CP_HOME_CARD); |
| 311 params.can_activate_children = true; | 312 params.can_activate_children = true; |
| 312 aura::Window* container = ScreenManager::Get()->CreateContainer(params); | 313 aura::Window* container = ScreenManager::Get()->CreateContainer(params); |
| 313 layout_manager_ = new HomeCardLayoutManager(this); | 314 layout_manager_ = new HomeCardLayoutManager(this); |
| 314 | 315 |
| 315 container->SetLayoutManager(layout_manager_); | 316 container->SetLayoutManager(layout_manager_); |
| 316 wm::SetChildWindowVisibilityChangesAnimated(container); | 317 wm::SetChildWindowVisibilityChangesAnimated(container); |
| 317 | 318 |
| 318 view_delegate_.reset(new AppListViewDelegate(model_builder_.get())); | 319 view_delegate_.reset(new AppListViewDelegate(model_builder_.get())); |
| 319 if (search_provider_) | 320 if (search_provider_) |
| 320 view_delegate_->RegisterSearchProvider(search_provider_.get()); | 321 view_delegate_->RegisterSearchProvider(search_provider_.get()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 instance = NULL; | 358 instance = NULL; |
| 358 } | 359 } |
| 359 | 360 |
| 360 // static | 361 // static |
| 361 HomeCard* HomeCard::Get() { | 362 HomeCard* HomeCard::Get() { |
| 362 DCHECK(instance); | 363 DCHECK(instance); |
| 363 return instance; | 364 return instance; |
| 364 } | 365 } |
| 365 | 366 |
| 366 } // namespace athena | 367 } // namespace athena |
| OLD | NEW |