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

Unified Diff: chrome/browser/push_messaging/push_messaging_service_observer.cc

Issue 1485743002: Push API: test that default notification is shown on Android when needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PushMessagingInstrumentationTest
Patch Set: Address peter's comments. Created 5 years 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/push_messaging/push_messaging_service_observer.cc
diff --git a/chrome/browser/push_messaging/push_messaging_service_observer.cc b/chrome/browser/push_messaging/push_messaging_service_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0b64443491464be5f8703c6646c805475c01df74
--- /dev/null
+++ b/chrome/browser/push_messaging/push_messaging_service_observer.cc
@@ -0,0 +1,19 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
Peter Beverloo 2015/12/10 18:47:51 With an #ifdef you'd be able to avoid having this
Michael van Ouwerkerk 2015/12/11 11:23:54 I'm not sure how you would avoid defining this fil
Peter Beverloo 2015/12/11 11:30:03 My question is why we need the Create() method at
Michael van Ouwerkerk 2015/12/11 11:38:24 That would move the ifdef to the callsite. One of
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/push_messaging/push_messaging_service_observer.h"
+
+#include "build/build_config.h"
+
+#if defined(OS_ANDROID)
+#include "chrome/browser/push_messaging/push_messaging_service_observer_android.h"
+#endif
+
+// static
+PushMessagingServiceObserver* PushMessagingServiceObserver::Create() {
+#if defined(OS_ANDROID)
+ return new PushMessagingServiceObserverAndroid();
+#endif
+ return nullptr;
+}

Powered by Google App Engine
This is Rietveld 408576698