Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_session_manager.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc |
| index 256e1190a53f8f5e27ed05387a91261cf7a7ec29..d7486cc88a207a16115fe9586493505ef165cd12 100644 |
| --- a/chrome/browser/chromeos/arc/arc_session_manager.cc |
| +++ b/chrome/browser/chromeos/arc/arc_session_manager.cc |
| @@ -15,6 +15,7 @@ |
| #include "base/strings/string16.h" |
| #include "base/time/time.h" |
| #include "chrome/browser/chromeos/arc/arc_auth_context.h" |
| +#include "chrome/browser/chromeos/arc/arc_auth_notification.h" |
| #include "chrome/browser/chromeos/arc/arc_optin_uma.h" |
| #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.h" |
| @@ -476,9 +477,20 @@ void ArcSessionManager::OnIsSyncingChanged() { |
| if (IsArcEnabled()) |
| OnOptInPreferenceChanged(); |
| + |
| + if (!g_disable_ui_for_testing && |
| + !base::CommandLine::ForCurrentProcess()->HasSwitch( |
|
khmel
2016/12/20 18:48:44
New in this CL, don't show notification if Arc OOB
|
| + chromeos::switches::kEnableArcOOBEOptIn) && |
| + profile_->IsNewProfile() && |
| + !profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { |
| + ArcAuthNotification::Show(profile_); |
| + } |
| } |
| void ArcSessionManager::Shutdown() { |
| + if (!g_disable_ui_for_testing) |
|
khmel
2016/12/20 18:48:44
There is no CloseUI equivalent that was in previou
xiyuan
2016/12/20 19:00:06
nit: Do we need this condition? Think we can alway
khmel
2016/12/20 19:13:12
Thank you for pointing this. Agree that there is a
xiyuan
2016/12/20 19:14:23
Acknowledged.
|
| + ArcAuthNotification::Hide(); |
| + |
| ShutdownBridge(); |
| if (support_host_) { |
| support_host_->Close(); |
| @@ -537,6 +549,13 @@ void ArcSessionManager::OnOptInPreferenceChanged() { |
| for (auto& observer : observer_list_) |
| observer.OnArcOptInChanged(arc_enabled); |
| + // Hide auth notification if it was opened before and arc.enabled pref was |
| + // explicitly set to true or false. |
| + if (!g_disable_ui_for_testing && |
| + profile_->GetPrefs()->HasPrefPath(prefs::kArcEnabled)) { |
|
khmel
2016/12/20 18:48:44
There is no CloseUI equivalent that was in previou
|
| + ArcAuthNotification::Hide(); |
| + } |
| + |
| if (!arc_enabled) { |
| // Reset any pending request to re-enable Arc. |
| reenable_arc_ = false; |