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

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

Issue 2941743002: Revert of Deprecate native and extension notification delegates. (Closed)
Patch Set: Created 3 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_common.cc
diff --git a/chrome/browser/notifications/notification_common.cc b/chrome/browser/notifications/notification_common.cc
index e180755a014e7c5b2a97a5b13f31ec4afd82f8cf..3320f6af8eb14996d7f69bf38bc66bad5a8caa5e 100644
--- a/chrome/browser/notifications/notification_common.cc
+++ b/chrome/browser/notifications/notification_common.cc
@@ -4,26 +4,11 @@
#include "chrome/browser/notifications/notification_common.h"
-#include "base/metrics/histogram_macros.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
-#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
-#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/browser_context.h"
-#include "ui/message_center/notifier_settings.h"
-
-namespace features {
-
-const base::Feature kAllowFullscreenWebNotificationsFeature{
- "FSNotificationsWeb", base::FEATURE_ENABLED_BY_DEFAULT};
-
-} // namespace features
// static
void NotificationCommon::OpenNotificationSettings(
@@ -45,48 +30,3 @@
}
#endif // defined(OS_ANDROID)
}
-
-// static
-bool NotificationCommon::ShouldDisplayOnFullScreen(Profile* profile,
- const GURL& origin) {
-#if defined(OS_ANDROID)
- NOTIMPLEMENTED();
- return false;
-#endif // defined(OS_ANDROID)
-
- // Check to see if this notification comes from a webpage that is displaying
- // fullscreen content.
- for (auto* browser : *BrowserList::GetInstance()) {
- // Only consider the browsers for the profile that created the notification
- if (browser->profile() != profile)
- continue;
-
- const content::WebContents* active_contents =
- browser->tab_strip_model()->GetActiveWebContents();
- if (!active_contents)
- continue;
-
- // Check to see if
- // (a) the active tab in the browser shares its origin with the
- // notification.
- // (b) the browser is fullscreen
- // (c) the browser has focus.
- if (active_contents->GetURL().GetOrigin() == origin &&
- browser->exclusive_access_manager()->context()->IsFullscreen() &&
- browser->window()->IsActive()) {
- bool enabled = base::FeatureList::IsEnabled(
- features::kAllowFullscreenWebNotificationsFeature);
- if (enabled) {
- UMA_HISTOGRAM_ENUMERATION("Notifications.Display_Fullscreen.Shown",
- message_center::NotifierId::WEB_PAGE,
- message_center::NotifierId::SIZE);
- } else {
- UMA_HISTOGRAM_ENUMERATION("Notifications.Display_Fullscreen.Suppressed",
- message_center::NotifierId::WEB_PAGE,
- message_center::NotifierId::SIZE);
- }
- return enabled;
- }
- }
- return false;
-}
« no previous file with comments | « chrome/browser/notifications/notification_common.h ('k') | chrome/browser/notifications/notification_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698