| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/help/version_updater_mac.h" | 5 #include "chrome/browser/ui/webui/help/version_updater_mac.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "chrome/browser/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
| 10 #import "chrome/browser/mac/keystone_glue.h" | 10 #import "chrome/browser/mac/keystone_glue.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 versionUpdater_->UpdateStatus([notification userInfo]); | 50 versionUpdater_->UpdateStatus([notification userInfo]); |
| 51 } | 51 } |
| 52 | 52 |
| 53 @end // @implementation KeystoneObserver | 53 @end // @implementation KeystoneObserver |
| 54 | 54 |
| 55 | 55 |
| 56 VersionUpdater* VersionUpdater::Create() { | 56 VersionUpdater* VersionUpdater::Create() { |
| 57 return new VersionUpdaterMac; | 57 return new VersionUpdaterMac; |
| 58 } | 58 } |
| 59 | 59 |
| 60 VersionUpdaterMac::VersionUpdaterMac() { | 60 VersionUpdaterMac::VersionUpdaterMac() |
| 61 keystone_observer_.reset([[KeystoneObserver alloc] initWithUpdater:this]); | 61 : show_promote_button_(false), |
| 62 keystone_observer_([[KeystoneObserver alloc] initWithUpdater:this]) { |
| 62 } | 63 } |
| 63 | 64 |
| 64 VersionUpdaterMac::~VersionUpdaterMac() { | 65 VersionUpdaterMac::~VersionUpdaterMac() { |
| 65 } | 66 } |
| 66 | 67 |
| 67 void VersionUpdaterMac::CheckForUpdate( | 68 void VersionUpdaterMac::CheckForUpdate( |
| 68 const StatusCallback& status_callback, | 69 const StatusCallback& status_callback, |
| 69 const PromoteCallback& promote_callback) { | 70 const PromoteCallback& promote_callback) { |
| 70 // Copy the callbacks, we will re-use this for the remaining lifetime | 71 // Copy the callbacks, we will re-use this for the remaining lifetime |
| 71 // of this object. | 72 // of this object. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } else if (recent_status == kAutoupdatePromoting || | 233 } else if (recent_status == kAutoupdatePromoting || |
| 233 recent_status == kAutoupdatePromoteFailed) { | 234 recent_status == kAutoupdatePromoteFailed) { |
| 234 // Show promotion UI because the user either just clicked that button or | 235 // Show promotion UI because the user either just clicked that button or |
| 235 // because the user should be able to click it again. | 236 // because the user should be able to click it again. |
| 236 show_promote_button_ = true; | 237 show_promote_button_ = true; |
| 237 } else { | 238 } else { |
| 238 // Show the promote button if promotion is a possibility. | 239 // Show the promote button if promotion is a possibility. |
| 239 show_promote_button_ = [keystone_glue wantsPromotion]; | 240 show_promote_button_ = [keystone_glue wantsPromotion]; |
| 240 } | 241 } |
| 241 } | 242 } |
| OLD | NEW |