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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 [[NSNotificationCenter defaultCenter] removeObserver:self]; | 46 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
47 [super dealloc]; | 47 [super dealloc]; |
48 } | 48 } |
49 | 49 |
50 - (void)handleStatusNotification:(NSNotification*)notification { | 50 - (void)handleStatusNotification:(NSNotification*)notification { |
51 versionUpdater_->UpdateStatus([notification userInfo]); | 51 versionUpdater_->UpdateStatus([notification userInfo]); |
52 } | 52 } |
53 | 53 |
54 @end // @implementation KeystoneObserver | 54 @end // @implementation KeystoneObserver |
55 | 55 |
56 VersionUpdater* VersionUpdater::Create(content::BrowserContext* /* context */) { | 56 VersionUpdater* VersionUpdater::Create( |
57 content::WebContents* /* web_contents */) { | |
Peter Kasting
2015/05/12 22:04:34
Nit: Same comment
| |
57 return new VersionUpdaterMac; | 58 return new VersionUpdaterMac; |
58 } | 59 } |
59 | 60 |
60 VersionUpdaterMac::VersionUpdaterMac() | 61 VersionUpdaterMac::VersionUpdaterMac() |
61 : show_promote_button_(false), | 62 : show_promote_button_(false), |
62 keystone_observer_([[KeystoneObserver alloc] initWithUpdater:this]) { | 63 keystone_observer_([[KeystoneObserver alloc] initWithUpdater:this]) { |
63 } | 64 } |
64 | 65 |
65 VersionUpdaterMac::~VersionUpdaterMac() { | 66 VersionUpdaterMac::~VersionUpdaterMac() { |
66 } | 67 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 } else if (recent_status == kAutoupdatePromoting || | 241 } else if (recent_status == kAutoupdatePromoting || |
241 recent_status == kAutoupdatePromoteFailed) { | 242 recent_status == kAutoupdatePromoteFailed) { |
242 // Show promotion UI because the user either just clicked that button or | 243 // Show promotion UI because the user either just clicked that button or |
243 // because the user should be able to click it again. | 244 // because the user should be able to click it again. |
244 show_promote_button_ = true; | 245 show_promote_button_ = true; |
245 } else { | 246 } else { |
246 // Show the promote button if promotion is a possibility. | 247 // Show the promote button if promotion is a possibility. |
247 show_promote_button_ = [keystone_glue wantsPromotion]; | 248 show_promote_button_ = [keystone_glue wantsPromotion]; |
248 } | 249 } |
249 } | 250 } |
OLD | NEW |