| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/notifications/fullscreen_notification_blocker.h" | 5 #include "chrome/browser/notifications/fullscreen_notification_blocker.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/fullscreen.h" | 9 #include "chrome/browser/fullscreen.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 ash::internal::RootWindowController* controller = | 26 ash::internal::RootWindowController* controller = |
| 27 ash::internal::RootWindowController::ForTargetRootWindow(); | 27 ash::internal::RootWindowController::ForTargetRootWindow(); |
| 28 | 28 |
| 29 // During shutdown |controller| can be NULL. | 29 // During shutdown |controller| can be NULL. |
| 30 if (!controller) | 30 if (!controller) |
| 31 return false; | 31 return false; |
| 32 | 32 |
| 33 // Block notifications if the shelf is hidden because of a fullscreen | 33 // Block notifications if the shelf is hidden because of a fullscreen |
| 34 // window. | 34 // window. |
| 35 const aura::Window* fullscreen_window = | 35 const aura::Window* fullscreen_window = |
| 36 controller->GetTopmostFullscreenWindow(); | 36 controller->GetWindowForFullscreenMode(); |
| 37 if (!fullscreen_window) | 37 if (!fullscreen_window) |
| 38 return false; | 38 return false; |
| 39 return ash::wm::GetWindowState(fullscreen_window)-> | 39 return ash::wm::GetWindowState(fullscreen_window)-> |
| 40 hide_shelf_when_fullscreen(); | 40 hide_shelf_when_fullscreen(); |
| 41 } | 41 } |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 return IsFullScreenMode(); | 44 return IsFullScreenMode(); |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return enabled; | 78 return enabled; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void FullscreenNotificationBlocker::Observe( | 81 void FullscreenNotificationBlocker::Observe( |
| 82 int type, | 82 int type, |
| 83 const content::NotificationSource& source, | 83 const content::NotificationSource& source, |
| 84 const content::NotificationDetails& details) { | 84 const content::NotificationDetails& details) { |
| 85 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 85 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
| 86 CheckState(); | 86 CheckState(); |
| 87 } | 87 } |
| OLD | NEW |