| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_auth_service.h" | 5 #include "chrome/browser/chromeos/arc/arc_auth_service.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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 632 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 633 observer_list_.AddObserver(observer); | 633 observer_list_.AddObserver(observer); |
| 634 } | 634 } |
| 635 | 635 |
| 636 void ArcAuthService::RemoveObserver(Observer* observer) { | 636 void ArcAuthService::RemoveObserver(Observer* observer) { |
| 637 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 637 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 638 observer_list_.RemoveObserver(observer); | 638 observer_list_.RemoveObserver(observer); |
| 639 } | 639 } |
| 640 | 640 |
| 641 void ArcAuthService::CloseUI() { | 641 void ArcAuthService::CloseUI() { |
| 642 ui_page_ = UIPage::NO_PAGE; |
| 643 ui_page_status_.clear(); |
| 642 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInUIClose()); | 644 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInUIClose()); |
| 643 SetUIPage(UIPage::NO_PAGE, base::string16()); | |
| 644 if (!g_disable_ui_for_testing) | 645 if (!g_disable_ui_for_testing) |
| 645 ArcAuthNotification::Hide(); | 646 ArcAuthNotification::Hide(); |
| 646 } | 647 } |
| 647 | 648 |
| 648 void ArcAuthService::SetUIPage(UIPage page, const base::string16& status) { | 649 void ArcAuthService::SetUIPage(UIPage page, const base::string16& status) { |
| 649 ui_page_ = page; | 650 ui_page_ = page; |
| 650 ui_page_status_ = status; | 651 ui_page_status_ = status; |
| 651 FOR_EACH_OBSERVER(Observer, observer_list_, | 652 FOR_EACH_OBSERVER(Observer, observer_list_, |
| 652 OnOptInUIShowPage(ui_page_, ui_page_status_)); | 653 OnOptInUIShowPage(ui_page_, ui_page_status_)); |
| 653 } | 654 } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 return os << kStateFetchingCode; | 910 return os << kStateFetchingCode; |
| 910 case ArcAuthService::State::ACTIVE: | 911 case ArcAuthService::State::ACTIVE: |
| 911 return os << kStateActive; | 912 return os << kStateActive; |
| 912 default: | 913 default: |
| 913 NOTREACHED(); | 914 NOTREACHED(); |
| 914 return os; | 915 return os; |
| 915 } | 916 } |
| 916 } | 917 } |
| 917 | 918 |
| 918 } // namespace arc | 919 } // namespace arc |
| OLD | NEW |