| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 instance = this; | 479 instance = this; |
| 480 WindowManager::GetInstance()->AddObserver(this); | 480 WindowManager::GetInstance()->AddObserver(this); |
| 481 } | 481 } |
| 482 | 482 |
| 483 HomeCardImpl::~HomeCardImpl() { | 483 HomeCardImpl::~HomeCardImpl() { |
| 484 DCHECK(instance); | 484 DCHECK(instance); |
| 485 WindowManager::GetInstance()->RemoveObserver(this); | 485 WindowManager::GetInstance()->RemoveObserver(this); |
| 486 if (activation_client_) | 486 if (activation_client_) |
| 487 activation_client_->RemoveObserver(this); | 487 activation_client_->RemoveObserver(this); |
| 488 home_card_widget_->CloseNow(); | 488 home_card_widget_->CloseNow(); |
| 489 | |
| 490 // Reset the view delegate first as it access search provider during | |
| 491 // shutdown. | |
| 492 view_delegate_.reset(); | |
| 493 search_provider_.reset(); | |
| 494 instance = NULL; | 489 instance = NULL; |
| 495 } | 490 } |
| 496 | 491 |
| 497 void HomeCardImpl::Init() { | 492 void HomeCardImpl::Init() { |
| 498 InstallAccelerators(); | 493 InstallAccelerators(); |
| 499 ScreenManager::ContainerParams params("HomeCardContainer", CP_HOME_CARD); | 494 ScreenManager::ContainerParams params("HomeCardContainer", CP_HOME_CARD); |
| 500 params.can_activate_children = true; | 495 params.can_activate_children = true; |
| 501 aura::Window* container = ScreenManager::Get()->CreateContainer(params); | 496 aura::Window* container = ScreenManager::Get()->CreateContainer(params); |
| 502 layout_manager_ = new HomeCardLayoutManager(this); | 497 layout_manager_ = new HomeCardLayoutManager(this); |
| 503 | 498 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 instance = NULL; | 659 instance = NULL; |
| 665 } | 660 } |
| 666 | 661 |
| 667 // static | 662 // static |
| 668 HomeCard* HomeCard::Get() { | 663 HomeCard* HomeCard::Get() { |
| 669 DCHECK(instance); | 664 DCHECK(instance); |
| 670 return instance; | 665 return instance; |
| 671 } | 666 } |
| 672 | 667 |
| 673 } // namespace athena | 668 } // namespace athena |
| OLD | NEW |