| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/notification/arc_boot_error_notification.h
" | 5 #include "chrome/browser/chromeos/arc/notification/arc_boot_error_notification.h
" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 11 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 12 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/chrome_pages.h" | 14 #include "chrome/browser/ui/chrome_pages.h" |
| 14 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 15 #include "components/arc/arc_bridge_service.h" | 16 #include "components/arc/arc_bridge_service.h" |
| 16 #include "components/user_manager/user_manager.h" | 17 #include "components/user_manager/user_manager.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/chromeos/resources/grit/ui_chromeos_resources.h" | 20 #include "ui/chromeos/resources/grit/ui_chromeos_resources.h" |
| 20 #include "ui/message_center/message_center.h" | 21 #include "ui/message_center/message_center.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 IDR_DISK_SPACE_NOTIFICATION_CRITICAL)), | 84 IDR_DISK_SPACE_NOTIFICATION_CRITICAL)), |
| 84 base::UTF8ToUTF16(kDisplaySource), GURL(), notifier_id, | 85 base::UTF8ToUTF16(kDisplaySource), GURL(), notifier_id, |
| 85 optional_fields, new LowDiskSpaceErrorNotificationDelegate())); | 86 optional_fields, new LowDiskSpaceErrorNotificationDelegate())); |
| 86 } | 87 } |
| 87 | 88 |
| 88 } // namespace | 89 } // namespace |
| 89 | 90 |
| 90 ArcBootErrorNotification::ArcBootErrorNotification( | 91 ArcBootErrorNotification::ArcBootErrorNotification( |
| 91 ArcBridgeService* bridge_service) | 92 ArcBridgeService* bridge_service) |
| 92 : ArcService(bridge_service) { | 93 : ArcService(bridge_service) { |
| 93 arc_bridge_service()->AddObserver(this); | 94 ArcSessionManager::Get()->AddSessionObserver(this); |
| 94 } | 95 } |
| 95 | 96 |
| 96 ArcBootErrorNotification::~ArcBootErrorNotification() { | 97 ArcBootErrorNotification::~ArcBootErrorNotification() { |
| 97 arc_bridge_service()->RemoveObserver(this); | 98 ArcSessionManager::Get()->RemoveSessionObserver(this); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void ArcBootErrorNotification::OnSessionStopped(StopReason reason) { | 101 void ArcBootErrorNotification::OnSessionStopped(StopReason reason) { |
| 101 if (reason == StopReason::LOW_DISK_SPACE) | 102 if (reason == StopReason::LOW_DISK_SPACE) |
| 102 ShowLowDiskSpaceErrorNotification(); | 103 ShowLowDiskSpaceErrorNotification(); |
| 103 } | 104 } |
| 104 | 105 |
| 105 } // namespace arc | 106 } // namespace arc |
| OLD | NEW |