| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/upgrade_detector.h" | 5 #include "chrome/browser/upgrade_detector.h" |
| 6 | 6 |
| 7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/common/chrome_notification_types.h" |
| 8 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 9 #include "content/common/notification_service.h" | 10 #include "content/common/notification_service.h" |
| 10 #include "content/common/notification_type.h" | |
| 11 #include "grit/theme_resources.h" | 11 #include "grit/theme_resources.h" |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { | 14 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { |
| 15 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); | 15 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); |
| 16 } | 16 } |
| 17 | 17 |
| 18 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { | 18 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { |
| 19 bool badge = type == UPGRADE_ICON_TYPE_BADGE; | 19 bool badge = type == UPGRADE_ICON_TYPE_BADGE; |
| 20 switch (upgrade_notification_stage_) { | 20 switch (upgrade_notification_stage_) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 notify_upgrade_(false) { | 36 notify_upgrade_(false) { |
| 37 } | 37 } |
| 38 | 38 |
| 39 UpgradeDetector::~UpgradeDetector() { | 39 UpgradeDetector::~UpgradeDetector() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 void UpgradeDetector::NotifyUpgradeDetected() { | 42 void UpgradeDetector::NotifyUpgradeDetected() { |
| 43 upgrade_detected_time_ = base::Time::Now(); | 43 upgrade_detected_time_ = base::Time::Now(); |
| 44 | 44 |
| 45 NotificationService::current()->Notify( | 45 NotificationService::current()->Notify( |
| 46 NotificationType::UPGRADE_DETECTED, | 46 chrome::NOTIFICATION_UPGRADE_DETECTED, |
| 47 Source<UpgradeDetector>(this), | 47 Source<UpgradeDetector>(this), |
| 48 NotificationService::NoDetails()); | 48 NotificationService::NoDetails()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void UpgradeDetector::NotifyUpgradeRecommended() { | 51 void UpgradeDetector::NotifyUpgradeRecommended() { |
| 52 notify_upgrade_ = true; | 52 notify_upgrade_ = true; |
| 53 | 53 |
| 54 NotificationService::current()->Notify( | 54 NotificationService::current()->Notify( |
| 55 NotificationType::UPGRADE_RECOMMENDED, | 55 chrome::NOTIFICATION_UPGRADE_RECOMMENDED, |
| 56 Source<UpgradeDetector>(this), | 56 Source<UpgradeDetector>(this), |
| 57 NotificationService::NoDetails()); | 57 NotificationService::NoDetails()); |
| 58 } | 58 } |
| OLD | NEW |