#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 {
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)
// 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)->
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(
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;