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 "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 observer_list_.AddObserver(observer); | 405 observer_list_.AddObserver(observer); |
406 } | 406 } |
407 | 407 |
408 void ArcAuthService::RemoveObserver(Observer* observer) { | 408 void ArcAuthService::RemoveObserver(Observer* observer) { |
409 DCHECK(thread_checker.Get().CalledOnValidThread()); | 409 DCHECK(thread_checker.Get().CalledOnValidThread()); |
410 observer_list_.RemoveObserver(observer); | 410 observer_list_.RemoveObserver(observer); |
411 } | 411 } |
412 | 412 |
413 void ArcAuthService::CloseUI() { | 413 void ArcAuthService::CloseUI() { |
414 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInUIClose()); | 414 FOR_EACH_OBSERVER(Observer, observer_list_, OnOptInUIClose()); |
| 415 SetUIPage(UIPage::NO_PAGE, base::string16()); |
415 if (!disable_ui_for_testing) | 416 if (!disable_ui_for_testing) |
416 ArcAuthNotification::Hide(); | 417 ArcAuthNotification::Hide(); |
417 } | 418 } |
418 | 419 |
419 void ArcAuthService::SetUIPage(UIPage page, const base::string16& status) { | 420 void ArcAuthService::SetUIPage(UIPage page, const base::string16& status) { |
420 ui_page_ = page; | 421 ui_page_ = page; |
421 ui_page_status_ = status; | 422 ui_page_status_ = status; |
422 FOR_EACH_OBSERVER(Observer, observer_list_, | 423 FOR_EACH_OBSERVER(Observer, observer_list_, |
423 OnOptInUIShowPage(ui_page_, ui_page_status_)); | 424 OnOptInUIShowPage(ui_page_, ui_page_status_)); |
424 } | 425 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 return os << kStateFetchingCode; | 536 return os << kStateFetchingCode; |
536 case ArcAuthService::State::ACTIVE: | 537 case ArcAuthService::State::ACTIVE: |
537 return os << kStateActive; | 538 return os << kStateActive; |
538 default: | 539 default: |
539 NOTREACHED(); | 540 NOTREACHED(); |
540 return os; | 541 return os; |
541 } | 542 } |
542 } | 543 } |
543 | 544 |
544 } // namespace arc | 545 } // namespace arc |
OLD | NEW |