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 const aura::Window* fullscreen_window = | 33 const aura::Window* fullscreen_window = |
34 controller->GetTopmostFullscreenWindow(); | 34 controller->GetTopmostFullscreenWindow(); |
35 | 35 |
36 // Should appear notifications if kFullscreenUsesMinimalChromeKey is set, | 36 // Notifications should appear if kFullscreenTypeKey is |
37 // since shelf/message_center UI is visible in such situation. | 37 // ash::wm::FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME because the shelf and |
38 return fullscreen_window && !fullscreen_window->GetProperty( | 38 // message center UI are visible in this case. |
39 ash::internal::kFullscreenUsesMinimalChromeKey); | 39 if (!fullscreen_window) |
| 40 return false; |
| 41 ash::wm::FullscreenType fullscreen_type = fullscreen_window->GetProperty( |
| 42 ash::internal::kFullscreenTypeKey); |
| 43 return fullscreen_type != ash::wm::FULLSCREEN_TYPE_IMMERSIVE_MINIMAL_CHROME; |
40 } | 44 } |
41 #endif | 45 #endif |
42 | 46 |
43 return IsFullScreenMode(); | 47 return IsFullScreenMode(); |
44 } | 48 } |
45 | 49 |
46 } // namespace | 50 } // namespace |
47 | 51 |
48 FullscreenNotificationBlocker::FullscreenNotificationBlocker( | 52 FullscreenNotificationBlocker::FullscreenNotificationBlocker( |
49 message_center::MessageCenter* message_center) | 53 message_center::MessageCenter* message_center) |
(...skipping 27 matching lines...) Expand all Loading... |
77 return enabled; | 81 return enabled; |
78 } | 82 } |
79 | 83 |
80 void FullscreenNotificationBlocker::Observe( | 84 void FullscreenNotificationBlocker::Observe( |
81 int type, | 85 int type, |
82 const content::NotificationSource& source, | 86 const content::NotificationSource& source, |
83 const content::NotificationDetails& details) { | 87 const content::NotificationDetails& details) { |
84 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 88 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
85 CheckState(); | 89 CheckState(); |
86 } | 90 } |
OLD | NEW |