Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: chrome/browser/ui/webui/help/version_updater_mac.mm

Issue 2873193002: Make update over cellular an option for user (Closed)
Patch Set: Put code in CHROME_OS wrapper to fix trybot error Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // kAutoupdateChecking. 101 // kAutoupdateChecking.
102 // 102 //
103 // Upon completion, kAutoupdateStatusNotification will be posted with a 103 // Upon completion, kAutoupdateStatusNotification will be posted with a
104 // status indicating the result of the check. 104 // status indicating the result of the check.
105 } 105 }
106 106
107 UpdateShowPromoteButton(); 107 UpdateShowPromoteButton();
108 } else { 108 } else {
109 // There is no glue, or the application is on a read-only filesystem. 109 // There is no glue, or the application is on a read-only filesystem.
110 // Updates and promotions are impossible. 110 // Updates and promotions are impossible.
111 status_callback_.Run(DISABLED, 0, base::string16()); 111 status_callback_.Run(DISABLED, 0, std::string(), 0, base::string16());
112 } 112 }
113 } 113 }
114 114
115 void VersionUpdaterMac::PromoteUpdater() const { 115 void VersionUpdaterMac::PromoteUpdater() const {
116 // Tell Keystone to make software updates available for all users. 116 // Tell Keystone to make software updates available for all users.
117 [[KeystoneGlue defaultKeystoneGlue] promoteTicket]; 117 [[KeystoneGlue defaultKeystoneGlue] promoteTicket];
118 118
119 // Immediately, kAutoupdateStatusNotification will be posted, and 119 // Immediately, kAutoupdateStatusNotification will be posted, and
120 // UpdateStatus() will be called with status kAutoupdatePromoting. 120 // UpdateStatus() will be called with status kAutoupdatePromoting.
121 // 121 //
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 229
230 message += l10n_util::GetStringUTF16(IDS_UPGRADE_ERROR_DETAILS); 230 message += l10n_util::GetStringUTF16(IDS_UPGRADE_ERROR_DETAILS);
231 message += base::UTF8ToUTF16("<br/><pre>"); 231 message += base::UTF8ToUTF16("<br/><pre>");
232 message += base::UTF8ToUTF16(net::EscapeForHTML(error_messages)); 232 message += base::UTF8ToUTF16(net::EscapeForHTML(error_messages));
233 message += base::UTF8ToUTF16("</pre>"); 233 message += base::UTF8ToUTF16("</pre>");
234 } 234 }
235 } 235 }
236 236
237 if (!status_callback_.is_null()) 237 if (!status_callback_.is_null())
238 status_callback_.Run(status, 0, message); 238 status_callback_.Run(status, 0, std::string(), 0, message);
239 239
240 PromotionState promotion_state; 240 PromotionState promotion_state;
241 if (!promote_callback_.is_null()) { 241 if (!promote_callback_.is_null()) {
242 KeystoneGlue* keystone_glue = [KeystoneGlue defaultKeystoneGlue]; 242 KeystoneGlue* keystone_glue = [KeystoneGlue defaultKeystoneGlue];
243 if (keystone_glue && [keystone_glue isAutoupdateEnabledForAllUsers]) { 243 if (keystone_glue && [keystone_glue isAutoupdateEnabledForAllUsers]) {
244 promotion_state = PROMOTED; 244 promotion_state = PROMOTED;
245 } else { 245 } else {
246 promotion_state = PROMOTE_HIDDEN; 246 promotion_state = PROMOTE_HIDDEN;
247 247
248 if (show_promote_button_) { 248 if (show_promote_button_) {
(...skipping 23 matching lines...) Expand all
272 } else if (recent_status == kAutoupdatePromoting || 272 } else if (recent_status == kAutoupdatePromoting ||
273 recent_status == kAutoupdatePromoteFailed) { 273 recent_status == kAutoupdatePromoteFailed) {
274 // Show promotion UI because the user either just clicked that button or 274 // Show promotion UI because the user either just clicked that button or
275 // because the user should be able to click it again. 275 // because the user should be able to click it again.
276 show_promote_button_ = true; 276 show_promote_button_ = true;
277 } else { 277 } else {
278 // Show the promote button if promotion is a possibility. 278 // Show the promote button if promotion is a possibility.
279 show_promote_button_ = [keystone_glue wantsPromotion]; 279 show_promote_button_ = [keystone_glue wantsPromotion];
280 } 280 }
281 } 281 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc ('k') | chrome/browser/ui/webui/help/version_updater_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698