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

Side by Side Diff: chrome/browser/notifications/fullscreen_notification_blocker.cc

Issue 2248913005: Revert of Use MD-ash's auto hide behavior for arc++ windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 19 matching lines...) Expand all
30 // During shutdown |controller| can be NULL. 30 // During shutdown |controller| can be NULL.
31 if (!controller) 31 if (!controller)
32 return false; 32 return false;
33 33
34 // Block notifications if the shelf is hidden because of a fullscreen 34 // Block notifications if the shelf is hidden because of a fullscreen
35 // window. 35 // window.
36 const aura::Window* fullscreen_window = 36 const aura::Window* fullscreen_window =
37 controller->GetWindowForFullscreenMode(); 37 controller->GetWindowForFullscreenMode();
38 if (!fullscreen_window) 38 if (!fullscreen_window)
39 return false; 39 return false;
40 return ash::wm::GetWindowState(fullscreen_window) 40 return ash::wm::GetWindowState(fullscreen_window)->
41 ->shelf_mode_in_fullscreen() == 41 hide_shelf_when_fullscreen();
42 ash::wm::WindowState::SHELF_HIDDEN;
43 } 42 }
44 #endif 43 #endif
45 44
46 return IsFullScreenMode(); 45 return IsFullScreenMode();
47 } 46 }
48 47
49 } // namespace 48 } // namespace
50 49
51 FullscreenNotificationBlocker::FullscreenNotificationBlocker( 50 FullscreenNotificationBlocker::FullscreenNotificationBlocker(
52 message_center::MessageCenter* message_center) 51 message_center::MessageCenter* message_center)
(...skipping 25 matching lines...) Expand all
78 return enabled; 77 return enabled;
79 } 78 }
80 79
81 void FullscreenNotificationBlocker::Observe( 80 void FullscreenNotificationBlocker::Observe(
82 int type, 81 int type,
83 const content::NotificationSource& source, 82 const content::NotificationSource& source,
84 const content::NotificationDetails& details) { 83 const content::NotificationDetails& details) {
85 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); 84 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
86 CheckState(); 85 CheckState();
87 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698