Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / ash / multi_user / multi_user_notification_blocker_chromeos.cc
index 55c62fa..b515a90 100644 (file)
@@ -4,38 +4,19 @@
 
 #include "chrome/browser/ui/ash/multi_user/multi_user_notification_blocker_chromeos.h"
 
-#include "ash/shell.h"
-#include "ash/shell_window_ids.h"
 #include "ash/system/system_notifier.h"
-#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
-#include "ui/aura/window.h"
 #include "ui/message_center/message_center.h"
 #include "ui/message_center/notifier_settings.h"
 
 MultiUserNotificationBlockerChromeOS::MultiUserNotificationBlockerChromeOS(
     message_center::MessageCenter* message_center,
-    chrome::MultiUserWindowManager* multi_user_window_manager,
     const std::string& initial_user_id)
     : NotificationBlocker(message_center),
-      multi_user_window_manager_(multi_user_window_manager),
       active_user_id_(initial_user_id) {
-  UpdateWindowOwners();
-  multi_user_window_manager_->AddObserver(this);
 }
 
 MultiUserNotificationBlockerChromeOS::~MultiUserNotificationBlockerChromeOS() {
-  multi_user_window_manager_->RemoveObserver(this);
-}
-
-void MultiUserNotificationBlockerChromeOS::UpdateWindowOwners() {
-  std::set<std::string> new_ids;
-  multi_user_window_manager_->GetOwnersOfVisibleWindows(&new_ids);
-
-  if (current_user_ids_ != new_ids) {
-    current_user_ids_.swap(new_ids);
-    NotifyBlockingStateChanged();
-  }
 }
 
 bool MultiUserNotificationBlockerChromeOS::ShouldShowNotification(
@@ -51,24 +32,7 @@ bool MultiUserNotificationBlockerChromeOS::ShouldShowNotification(
 
 bool MultiUserNotificationBlockerChromeOS::ShouldShowNotificationAsPopup(
     const message_center::NotifierId& notifier_id) const {
-  return (current_user_ids_.find(notifier_id.profile_id) !=
-          current_user_ids_.end()) ||
-      ShouldShowNotification(notifier_id);
-}
-
-void MultiUserNotificationBlockerChromeOS::OnOwnerEntryAdded(
-    aura::Window* window) {
-  UpdateWindowOwners();
-}
-
-void MultiUserNotificationBlockerChromeOS::OnOwnerEntryChanged(
-    aura::Window* window) {
-  UpdateWindowOwners();
-}
-
-void MultiUserNotificationBlockerChromeOS::OnOwnerEntryRemoved(
-    aura::Window* window) {
-  UpdateWindowOwners();
+  return ShouldShowNotification(notifier_id);
 }
 
 void MultiUserNotificationBlockerChromeOS::ActiveUserChanged(
@@ -84,7 +48,6 @@ void MultiUserNotificationBlockerChromeOS::ActiveUserChanged(
       iter->second != message_center()->IsQuietMode()) {
     message_center()->SetQuietMode(iter->second);
   }
-  UpdateWindowOwners();
   NotifyBlockingStateChanged();
 }