| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 Task* upgrade_detected_task_; | 149 Task* upgrade_detected_task_; |
| 150 bool* is_unstable_channel_; | 150 bool* is_unstable_channel_; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace | 153 } // namespace |
| 154 | 154 |
| 155 // static | 155 // static |
| 156 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { | 156 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { |
| 157 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); | 157 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, |
| 158 false, |
| 159 false /* don't sync pref */); |
| 158 } | 160 } |
| 159 | 161 |
| 160 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { | 162 int UpgradeDetector::GetIconResourceID(UpgradeNotificationIconType type) { |
| 161 bool badge = type == UPGRADE_ICON_TYPE_BADGE; | 163 bool badge = type == UPGRADE_ICON_TYPE_BADGE; |
| 162 switch (upgrade_notification_stage_) { | 164 switch (upgrade_notification_stage_) { |
| 163 case UPGRADE_ANNOYANCE_SEVERE: | 165 case UPGRADE_ANNOYANCE_SEVERE: |
| 164 return badge ? IDR_UPDATE_BADGE4 : IDR_UPDATE_MENU4; | 166 return badge ? IDR_UPDATE_BADGE4 : IDR_UPDATE_MENU4; |
| 165 case UPGRADE_ANNOYANCE_HIGH: | 167 case UPGRADE_ANNOYANCE_HIGH: |
| 166 return badge ? IDR_UPDATE_BADGE3 : IDR_UPDATE_MENU3; | 168 return badge ? IDR_UPDATE_BADGE3 : IDR_UPDATE_MENU3; |
| 167 case UPGRADE_ANNOYANCE_ELEVATED: | 169 case UPGRADE_ANNOYANCE_ELEVATED: |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 291 } |
| 290 } | 292 } |
| 291 | 293 |
| 292 notify_upgrade_ = true; | 294 notify_upgrade_ = true; |
| 293 | 295 |
| 294 NotificationService::current()->Notify( | 296 NotificationService::current()->Notify( |
| 295 NotificationType::UPGRADE_RECOMMENDED, | 297 NotificationType::UPGRADE_RECOMMENDED, |
| 296 Source<UpgradeDetector>(this), | 298 Source<UpgradeDetector>(this), |
| 297 NotificationService::NoDetails()); | 299 NotificationService::NoDetails()); |
| 298 } | 300 } |
| OLD | NEW |