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

Unified Diff: chrome/browser/notifications/notification_operation_common.cc

Issue 2093953002: Introduce a new API to handle native notification clicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/notifications/notification_operation_common.cc
diff --git a/chrome/browser/notifications/notification_operation_common.cc b/chrome/browser/notifications/notification_operation_common.cc
new file mode 100644
index 0000000000000000000000000000000000000000..915e1098a51c6c5d7f021fbeaa1778df14a2bb99
--- /dev/null
+++ b/chrome/browser/notifications/notification_operation_common.cc
@@ -0,0 +1,35 @@
+// Copyright 2016 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/notifications/notification_operation_common.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
+#include "chrome/common/chrome_switches.h"
+#include "content/public/browser/browser_context.h"
+
+namespace notification_operation_common {
+
+void OpenNotificationSettings(content::BrowserContext* browser_context) {
+#if defined(OS_ANDROID)
+ NOTIMPLEMENTED();
+#else
+
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ DCHECK(profile);
+
+ if (switches::SettingsWindowEnabled()) {
+ chrome::ShowContentSettingsExceptionsInWindow(
+ profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
+ } else {
+ chrome::ScopedTabbedBrowserDisplayer browser_displayer(profile);
+ chrome::ShowContentSettingsExceptions(browser_displayer.browser(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
+ }
+
+#endif // defined(OS_ANDROID)
+}
+
+} // namespace notification_operation_common

Powered by Google App Engine
This is Rietveld 408576698