Update EOL message and show EOL notification to guest users.
Bug: 717259,747360
Change-Id: I408764b66d70dbc1061ef1c6aa974d3ce297376a
Reviewed-on: https://chromium-review.googlesource.com/786435
Commit-Queue: Xiaoyin Hu <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Cr-Commit-Position: refs/heads/master@{#519356}
diff --git a/chrome/browser/chromeos/eol_notification.cc b/chrome/browser/chromeos/eol_notification.cc
index 260740e..e21eb65 100644
--- a/chrome/browser/chromeos/eol_notification.cc
+++ b/chrome/browser/chromeos/eol_notification.cc
@@ -6,6 +6,7 @@
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/notifications/notification_display_service.h"
#include "chrome/browser/notifications/notification_display_service_factory.h"
#include "chrome/browser/ui/browser_navigator.h"
@@ -13,6 +14,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
+#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/update_engine_client.h"
#include "components/prefs/pref_service.h"
@@ -78,6 +80,24 @@
} // namespace
+// static
+bool EolNotification::ShouldShowEolNotification() {
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kDisableEolNotification)) {
+ return false;
+ }
+
+ // Do not show end of life notification if this device is managed by
+ // enterprise user.
+ if (g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->IsEnterpriseManaged()) {
+ return false;
+ }
+
+ return true;
+}
+
EolNotification::EolNotification(Profile* profile)
: profile_(profile),
status_(update_engine::EndOfLifeStatus::kSupported),