Index: chrome/browser/chromeos/arc/arc_auth_notification.cc |
diff --git a/chrome/browser/chromeos/arc/arc_auth_notification.cc b/chrome/browser/chromeos/arc/arc_auth_notification.cc |
index 03cfabc7c351d3e5a044566d2c6742bd4809e222..5e88434b84f51a6854d6d03ff8551bd54f7073f1 100644 |
--- a/chrome/browser/chromeos/arc/arc_auth_notification.cc |
+++ b/chrome/browser/chromeos/arc/arc_auth_notification.cc |
@@ -12,7 +12,7 @@ |
#include "base/macros.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/chromeos/arc/arc_optin_uma.h" |
-#include "chrome/browser/chromeos/arc/arc_session_manager.h" |
+#include "chrome/browser/chromeos/arc/arc_util.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
#include "chrome/grit/generated_resources.h" |
@@ -37,7 +37,7 @@ class ArcAuthNotificationDelegate |
: public message_center::NotificationDelegate, |
public message_center::MessageCenterObserver { |
public: |
- ArcAuthNotificationDelegate() {} |
+ explicit ArcAuthNotificationDelegate(Profile* profile) : profile_(profile) {} |
// message_center::MessageCenterObserver |
void OnNotificationUpdated(const std::string& notification_id) override { |
@@ -64,10 +64,10 @@ class ArcAuthNotificationDelegate |
StopObserving(); |
if (button_index == 0) { |
UpdateOptInActionUMA(arc::OptInActionType::NOTIFICATION_ACCEPTED); |
- arc::ArcSessionManager::Get()->SetArcPlayStoreEnabled(true); |
+ arc::SetArcPlayStoreEnabledForProfile(profile_, true); |
} else { |
UpdateOptInActionUMA(arc::OptInActionType::NOTIFICATION_DECLINED); |
- arc::ArcSessionManager::Get()->SetArcPlayStoreEnabled(false); |
+ arc::SetArcPlayStoreEnabledForProfile(profile_, false); |
} |
} |
@@ -84,6 +84,8 @@ class ArcAuthNotificationDelegate |
message_center::MessageCenter::Get()->RemoveObserver(this); |
} |
+ Profile* profile_; |
xiyuan
2017/02/17 17:45:40
nit: Profile* const profile_;
hidehiko
2017/02/20 18:18:44
Done.
|
+ |
DISALLOW_COPY_AND_ASSIGN(ArcAuthNotificationDelegate); |
}; |
@@ -112,7 +114,7 @@ void ArcAuthNotification::Show(Profile* profile) { |
ash::GetChromeOSDeviceName()), |
resource_bundle.GetImageNamed(IDR_ARC_PLAY_STORE_NOTIFICATION), |
base::UTF8ToUTF16(kDisplaySource), GURL(), notifier_id, data, |
- new ArcAuthNotificationDelegate())); |
+ new ArcAuthNotificationDelegate(profile))); |
message_center::MessageCenter::Get()->AddNotification( |
std::move(notification)); |
} |