Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5447)

Unified Diff: chrome/browser/chromeos/arc/arc_auth_notification.cc

Issue 2709393003: Split ArcAuthNotification UI control flag from ArcSessionManager. (Closed)
Patch Set: Address comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 133a5540cda1afd7ff0fa709652b07a0ec82c2ca..ced355f4dc38f4333423fcd57040219a7bd2cdde 100644
--- a/chrome/browser/chromeos/arc/arc_auth_notification.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_notification.cc
@@ -28,6 +28,8 @@
namespace {
+bool g_disabled = false;
+
// Ids of the notification shown on first run.
const char kNotifierId[] = "arc_auth";
const char kDisplaySource[] = "arc_auth_source";
@@ -95,6 +97,9 @@ namespace arc {
// static
void ArcAuthNotification::Show(Profile* profile) {
+ if (g_disabled)
+ return;
+
message_center::NotifierId notifier_id(
message_center::NotifierId::SYSTEM_COMPONENT, kNotifierId);
notifier_id.profile_id =
@@ -121,8 +126,16 @@ void ArcAuthNotification::Show(Profile* profile) {
// static
void ArcAuthNotification::Hide() {
+ if (g_disabled)
+ return;
+
message_center::MessageCenter::Get()->RemoveNotification(
kFirstRunNotificationId, false);
}
+// static
+void ArcAuthNotification::DisableForTesting() {
+ g_disabled = true;
+}
+
} // namespace arc
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_notification.h ('k') | chrome/browser/chromeos/arc/arc_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698