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

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

Issue 2248773002: 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 hide_shelf_when_fullscreen(); 41 ->shelf_mode_in_fullscreen() ==
42 ash::wm::WindowState::SHELF_HIDDEN;
42 } 43 }
43 #endif 44 #endif
44 45
45 return IsFullScreenMode(); 46 return IsFullScreenMode();
46 } 47 }
47 48
48 } // namespace 49 } // namespace
49 50
50 FullscreenNotificationBlocker::FullscreenNotificationBlocker( 51 FullscreenNotificationBlocker::FullscreenNotificationBlocker(
51 message_center::MessageCenter* message_center) 52 message_center::MessageCenter* message_center)
(...skipping 25 matching lines...) Expand all
77 return enabled; 78 return enabled;
78 } 79 }
79 80
80 void FullscreenNotificationBlocker::Observe( 81 void FullscreenNotificationBlocker::Observe(
81 int type, 82 int type,
82 const content::NotificationSource& source, 83 const content::NotificationSource& source,
83 const content::NotificationDetails& details) { 84 const content::NotificationDetails& details) {
84 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); 85 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
85 CheckState(); 86 CheckState();
86 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698