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

Unified Diff: chrome/browser/signin/easy_unlock_notification_controller.cc

Issue 2968323002: [EasyUnlock] Introduce EasyUnlockNotificationController (Closed)
Patch Set: fix unittests Created 3 years, 5 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/signin/easy_unlock_notification_controller.cc
diff --git a/chrome/browser/signin/easy_unlock_notification_controller.cc b/chrome/browser/signin/easy_unlock_notification_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ed81e029fff50f74a3abf8a5575a9062bf575ecd
--- /dev/null
+++ b/chrome/browser/signin/easy_unlock_notification_controller.cc
@@ -0,0 +1,46 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/easy_unlock_notification_controller.h"
+
+#include "base/memory/ptr_util.h"
+#include "build/build_config.h"
+
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/signin/easy_unlock_notification_controller_chromeos.h"
+#include "ui/message_center/message_center.h"
+#endif
+
+namespace {
+
+// Stub implementation of EasyUnlockNotificationController for non-ChromeOS
+// platforms.
+class EasyUnlockNotificationControllerStub
+ : public EasyUnlockNotificationController {
+ public:
+ EasyUnlockNotificationControllerStub() {}
+ ~EasyUnlockNotificationControllerStub() override {}
+
+ // EasyUnlockNotificationController:
+ void ShowChromebookAddedNotification() override {}
+ void ShowPairingChangeNotification() override {}
+ void ShowPairingChangeAppliedNotification(
+ const std::string& phone_name) override {}
+ void ShowPromotionNotification() override {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EasyUnlockNotificationControllerStub);
+};
+
+} // namespace
+
+std::unique_ptr<EasyUnlockNotificationController>
+EasyUnlockNotificationController::Create(Profile* profile) {
+#if defined(OS_CHROMEOS)
+ return base::MakeUnique<EasyUnlockNotificationControllerChromeOS>(
+ profile, message_center::MessageCenter::Get());
+#else
+ return base::MakeUnique<EasyUnlockNotificationControllerStub>();
+#endif
+}

Powered by Google App Engine
This is Rietveld 408576698