Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / notifications / fullscreen_notification_blocker.cc
index bbfa582..55e2304 100644 (file)
@@ -14,8 +14,8 @@
 #include "ash/shell.h"
 #include "ash/system/system_notifier.h"
 #include "ash/wm/window_state.h"
-#include "ui/aura/root_window.h"
 #include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
 #endif
 
 namespace {
@@ -23,8 +23,8 @@ namespace {
 bool DoesFullscreenModeBlockNotifications() {
 #if defined(USE_ASH)
   if (ash::Shell::HasInstance()) {
-    ash::internal::RootWindowController* controller =
-        ash::internal::RootWindowController::ForTargetRootWindow();
+    ash::RootWindowController* controller =
+        ash::RootWindowController::ForTargetRootWindow();
 
     // During shutdown |controller| can be NULL.
     if (!controller)
@@ -33,7 +33,7 @@ bool DoesFullscreenModeBlockNotifications() {
     // Block notifications if the shelf is hidden because of a fullscreen
     // window.
     const aura::Window* fullscreen_window =
-        controller->GetTopmostFullscreenWindow();
+        controller->GetWindowForFullscreenMode();
     if (!fullscreen_window)
       return false;
     return ash::wm::GetWindowState(fullscreen_window)->
@@ -60,10 +60,8 @@ FullscreenNotificationBlocker::~FullscreenNotificationBlocker() {
 void FullscreenNotificationBlocker::CheckState() {
   bool was_fullscreen_mode = is_fullscreen_mode_;
   is_fullscreen_mode_ = DoesFullscreenModeBlockNotifications();
-  if (is_fullscreen_mode_ != was_fullscreen_mode) {
-    FOR_EACH_OBSERVER(
-        NotificationBlocker::Observer, observers(), OnBlockingStateChanged());
-  }
+  if (is_fullscreen_mode_ != was_fullscreen_mode)
+    NotifyBlockingStateChanged();
 }
 
 bool FullscreenNotificationBlocker::ShouldShowNotificationAsPopup(
@@ -71,8 +69,8 @@ bool FullscreenNotificationBlocker::ShouldShowNotificationAsPopup(
   bool enabled = !is_fullscreen_mode_;
 #if defined(USE_ASH)
   if (ash::Shell::HasInstance())
-    enabled = enabled ||
-        ash::system_notifier::ShouldAlwaysShowPopups(notifier_id);
+    enabled = enabled || ash::system_notifier::ShouldAlwaysShowPopups(
+        notifier_id);
 #endif
 
   return enabled;