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

Side by Side Diff: ash/first_run/desktop_cleaner.cc

Issue 2198363002: Pass Notification into NotificationBlocker ShouldShow* methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ash build errors 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
« no previous file with comments | « no previous file | chrome/browser/notifications/fullscreen_notification_blocker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/first_run/desktop_cleaner.h" 5 #include "ash/first_run/desktop_cleaner.h"
6 6
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ui/aura/window_event_dispatcher.h" 9 #include "ui/aura/window_event_dispatcher.h"
10 #include "ui/aura/window_observer.h" 10 #include "ui/aura/window_observer.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 : message_center::NotificationBlocker( 75 : message_center::NotificationBlocker(
76 message_center::MessageCenter::Get()) { 76 message_center::MessageCenter::Get()) {
77 NotifyBlockingStateChanged(); 77 NotifyBlockingStateChanged();
78 } 78 }
79 79
80 ~NotificationBlocker() override {} 80 ~NotificationBlocker() override {}
81 81
82 private: 82 private:
83 // Overriden from message_center::NotificationBlocker. 83 // Overriden from message_center::NotificationBlocker.
84 bool ShouldShowNotificationAsPopup( 84 bool ShouldShowNotificationAsPopup(
85 const message_center::NotifierId& notifier_id) const override { 85 const message_center::Notification& notification) const override {
86 return false; 86 return false;
87 } 87 }
88 88
89 DISALLOW_COPY_AND_ASSIGN(NotificationBlocker); 89 DISALLOW_COPY_AND_ASSIGN(NotificationBlocker);
90 }; 90 };
91 91
92 DesktopCleaner::DesktopCleaner() { 92 DesktopCleaner::DesktopCleaner() {
93 // TODO(dzhioev): Add support for secondary displays. 93 // TODO(dzhioev): Add support for secondary displays.
94 aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); 94 aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
95 for (size_t i = 0; i < arraysize(kContainerIdsToHide); ++i) { 95 for (size_t i = 0; i < arraysize(kContainerIdsToHide); ++i) {
96 aura::Window* container = 96 aura::Window* container =
97 Shell::GetContainer(root_window, kContainerIdsToHide[i]); 97 Shell::GetContainer(root_window, kContainerIdsToHide[i]);
98 container_hiders_.push_back(make_linked_ptr(new ContainerHider(container))); 98 container_hiders_.push_back(make_linked_ptr(new ContainerHider(container)));
99 } 99 }
100 notification_blocker_.reset(new NotificationBlocker()); 100 notification_blocker_.reset(new NotificationBlocker());
101 } 101 }
102 102
103 DesktopCleaner::~DesktopCleaner() {} 103 DesktopCleaner::~DesktopCleaner() {}
104 104
105 // static 105 // static
106 std::vector<int> DesktopCleaner::GetContainersToHideForTest() { 106 std::vector<int> DesktopCleaner::GetContainersToHideForTest() {
107 return std::vector<int>(kContainerIdsToHide, 107 return std::vector<int>(kContainerIdsToHide,
108 kContainerIdsToHide + arraysize(kContainerIdsToHide)); 108 kContainerIdsToHide + arraysize(kContainerIdsToHide));
109 } 109 }
110 110
111 } // namespace ash 111 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/fullscreen_notification_blocker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698