| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/chromeos/arc/arc_session_manager.h" | 5 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/shelf/shelf_delegate.h" | 9 #include "ash/common/shelf/shelf_delegate.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 arc_sign_in_timer_.Stop(); | 617 arc_sign_in_timer_.Stop(); |
| 618 playstore_launcher_.reset(); | 618 playstore_launcher_.reset(); |
| 619 terms_of_service_negotiator_.reset(); | 619 terms_of_service_negotiator_.reset(); |
| 620 android_management_checker_.reset(); | 620 android_management_checker_.reset(); |
| 621 arc_session_runner_->RequestStop(); | 621 arc_session_runner_->RequestStop(); |
| 622 // TODO(hidehiko): The ARC instance's stopping is asynchronous, so it might | 622 // TODO(hidehiko): The ARC instance's stopping is asynchronous, so it might |
| 623 // still be running when we return from this function. Do not set the | 623 // still be running when we return from this function. Do not set the |
| 624 // STOPPED state immediately here. | 624 // STOPPED state immediately here. |
| 625 if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR) | 625 if (state_ != State::NOT_INITIALIZED && state_ != State::REMOVING_DATA_DIR) |
| 626 SetState(State::STOPPED); | 626 SetState(State::STOPPED); |
| 627 for (auto& observer : observer_list_) | |
| 628 observer.OnArcBridgeShutdown(); | |
| 629 } | 627 } |
| 630 | 628 |
| 631 void ArcSessionManager::AddObserver(Observer* observer) { | 629 void ArcSessionManager::AddObserver(Observer* observer) { |
| 632 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 630 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 633 observer_list_.AddObserver(observer); | 631 observer_list_.AddObserver(observer); |
| 634 } | 632 } |
| 635 | 633 |
| 636 void ArcSessionManager::RemoveObserver(Observer* observer) { | 634 void ArcSessionManager::RemoveObserver(Observer* observer) { |
| 637 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 635 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 638 observer_list_.RemoveObserver(observer); | 636 observer_list_.RemoveObserver(observer); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 | 960 |
| 963 #undef MAP_STATE | 961 #undef MAP_STATE |
| 964 | 962 |
| 965 // Some compilers report an error even if all values of an enum-class are | 963 // Some compilers report an error even if all values of an enum-class are |
| 966 // covered exhaustively in a switch statement. | 964 // covered exhaustively in a switch statement. |
| 967 NOTREACHED() << "Invalid value " << static_cast<int>(state); | 965 NOTREACHED() << "Invalid value " << static_cast<int>(state); |
| 968 return os; | 966 return os; |
| 969 } | 967 } |
| 970 | 968 |
| 971 } // namespace arc | 969 } // namespace arc |
| OLD | NEW |