| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/file_system_provider/notification_manager.h" | 5 #include "chrome/browser/chromeos/file_system_provider/notification_manager.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_app_icon_loader.h" | 10 #include "chrome/browser/extensions/chrome_app_icon_loader.h" |
| 11 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 11 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 12 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 13 #include "components/signin/core/account_id/account_id.h" | 13 #include "components/signin/core/account_id/account_id.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 #include "ui/message_center/message_center.h" | 15 #include "ui/message_center/message_center.h" |
| 16 #include "ui/message_center/notification.h" | 16 #include "ui/message_center/notification.h" |
| 17 #include "ui/message_center/notification_delegate.h" | 17 #include "ui/message_center/notification_delegate.h" |
| 18 #include "ui/message_center/notification_types.h" | 18 #include "ui/message_center/notification_types.h" |
| 19 #include "ui/message_center/notifier_settings.h" | 19 #include "ui/message_center/notifier_settings.h" |
| 20 | 20 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 NotificationManager::NotificationManager( | 53 NotificationManager::NotificationManager( |
| 54 Profile* profile, | 54 Profile* profile, |
| 55 const ProvidedFileSystemInfo& file_system_info) | 55 const ProvidedFileSystemInfo& file_system_info) |
| 56 : profile_(profile), | 56 : profile_(profile), |
| 57 file_system_info_(file_system_info), | 57 file_system_info_(file_system_info), |
| 58 icon_loader_( | 58 icon_loader_( |
| 59 new extensions::ExtensionAppIconLoader(profile, kIconSize, this)) {} | 59 new extensions::ChromeAppIconLoader(profile, kIconSize, this)) {} |
| 60 | 60 |
| 61 NotificationManager::~NotificationManager() { | 61 NotificationManager::~NotificationManager() { |
| 62 if (callbacks_.size()) { | 62 if (callbacks_.size()) { |
| 63 g_browser_process->message_center()->RemoveNotification( | 63 g_browser_process->message_center()->RemoveNotification( |
| 64 file_system_info_.mount_path().value(), false /* by_user */); | 64 file_system_info_.mount_path().value(), false /* by_user */); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void NotificationManager::ShowUnresponsiveNotification( | 68 void NotificationManager::ShowUnresponsiveNotification( |
| 69 int id, | 69 int id, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 while (it != callbacks_.end()) { | 145 while (it != callbacks_.end()) { |
| 146 CallbackMap::iterator current_it = it++; | 146 CallbackMap::iterator current_it = it++; |
| 147 NotificationCallback callback = current_it->second; | 147 NotificationCallback callback = current_it->second; |
| 148 callbacks_.erase(current_it); | 148 callbacks_.erase(current_it); |
| 149 callback.Run(result); | 149 callback.Run(result); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace file_system_provider | 153 } // namespace file_system_provider |
| 154 } // namespace chromeos | 154 } // namespace chromeos |
| OLD | NEW |