| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 Task* upgrade_detected_task_; | 147 Task* upgrade_detected_task_; |
| 148 bool* is_unstable_channel_; | 148 bool* is_unstable_channel_; |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| 152 | 152 |
| 153 // static | 153 // static |
| 154 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { | 154 void UpgradeDetector::RegisterPrefs(PrefService* prefs) { |
| 155 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, false); | 155 prefs->RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, |
| 156 false, |
| 157 false /* don't sync pref */); |
| 156 } | 158 } |
| 157 | 159 |
| 158 UpgradeDetector::UpgradeDetector() | 160 UpgradeDetector::UpgradeDetector() |
| 159 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), | 161 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), |
| 160 is_unstable_channel_(false), | 162 is_unstable_channel_(false), |
| 161 upgrade_notification_stage_(UPGRADE_ANNOYANCE_NONE), | 163 upgrade_notification_stage_(UPGRADE_ANNOYANCE_NONE), |
| 162 notify_upgrade_(false) { | 164 notify_upgrade_(false) { |
| 163 CommandLine command_line(*CommandLine::ForCurrentProcess()); | 165 CommandLine command_line(*CommandLine::ForCurrentProcess()); |
| 164 if (command_line.HasSwitch(switches::kDisableBackgroundNetworking)) | 166 if (command_line.HasSwitch(switches::kDisableBackgroundNetworking)) |
| 165 return; | 167 return; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 upgrade_notification_timer_.Stop(); | 259 upgrade_notification_timer_.Stop(); |
| 258 } | 260 } |
| 259 | 261 |
| 260 notify_upgrade_ = true; | 262 notify_upgrade_ = true; |
| 261 | 263 |
| 262 NotificationService::current()->Notify( | 264 NotificationService::current()->Notify( |
| 263 NotificationType::UPGRADE_RECOMMENDED, | 265 NotificationType::UPGRADE_RECOMMENDED, |
| 264 Source<UpgradeDetector>(this), | 266 Source<UpgradeDetector>(this), |
| 265 NotificationService::NoDetails()); | 267 NotificationService::NoDetails()); |
| 266 } | 268 } |
| OLD | NEW |