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

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

Issue 2039273003: Cleanup: Remove VersionUpdater::RelaunchBrowser interface method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comment. Created 4 years, 6 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"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/strings/sys_string_conversions.h" 12 #include "base/strings/sys_string_conversions.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/browser/lifetime/application_lifetime.h"
15 #import "chrome/browser/mac/keystone_glue.h" 14 #import "chrome/browser/mac/keystone_glue.h"
16 #include "chrome/browser/obsolete_system/obsolete_system.h" 15 #include "chrome/browser/obsolete_system/obsolete_system.h"
17 #include "chrome/grit/chromium_strings.h" 16 #include "chrome/grit/chromium_strings.h"
18 #include "chrome/grit/generated_resources.h" 17 #include "chrome/grit/generated_resources.h"
19 #include "net/base/escape.h" 18 #include "net/base/escape.h"
20 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
21 20
22 // KeystoneObserver is a simple notification observer for Keystone status 21 // KeystoneObserver is a simple notification observer for Keystone status
23 // updates. It will be created and managed by VersionUpdaterMac. 22 // updates. It will be created and managed by VersionUpdaterMac.
24 @interface KeystoneObserver : NSObject { 23 @interface KeystoneObserver : NSObject {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // 122 //
124 // Upon completion, kAutoupdateStatusNotification will be posted, and 123 // Upon completion, kAutoupdateStatusNotification will be posted, and
125 // UpdateStatus() will be called with a status indicating a result of the 124 // UpdateStatus() will be called with a status indicating a result of the
126 // installation attempt. 125 // installation attempt.
127 // 126 //
128 // If the promotion was successful, KeystoneGlue will re-register the ticket 127 // If the promotion was successful, KeystoneGlue will re-register the ticket
129 // and UpdateStatus() will be called again indicating first that 128 // and UpdateStatus() will be called again indicating first that
130 // registration is in progress and subsequently that it has completed. 129 // registration is in progress and subsequently that it has completed.
131 } 130 }
132 131
133 void VersionUpdaterMac::RelaunchBrowser() const {
134 // Tell the Broweser to restart if possible.
135 chrome::AttemptRestart();
136 }
137
138 void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) { 132 void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) {
139 AutoupdateStatus keystone_status = static_cast<AutoupdateStatus>( 133 AutoupdateStatus keystone_status = static_cast<AutoupdateStatus>(
140 [base::mac::ObjCCastStrict<NSNumber>( 134 [base::mac::ObjCCastStrict<NSNumber>(
141 [dictionary objectForKey:kAutoupdateStatusStatus]) intValue]); 135 [dictionary objectForKey:kAutoupdateStatusStatus]) intValue]);
142 std::string error_messages = base::SysNSStringToUTF8( 136 std::string error_messages = base::SysNSStringToUTF8(
143 base::mac::ObjCCastStrict<NSString>( 137 base::mac::ObjCCastStrict<NSString>(
144 [dictionary objectForKey:kAutoupdateStatusErrorMessages])); 138 [dictionary objectForKey:kAutoupdateStatusErrorMessages]));
145 139
146 bool enable_promote_button = true; 140 bool enable_promote_button = true;
147 base::string16 message; 141 base::string16 message;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } else if (recent_status == kAutoupdatePromoting || 264 } else if (recent_status == kAutoupdatePromoting ||
271 recent_status == kAutoupdatePromoteFailed) { 265 recent_status == kAutoupdatePromoteFailed) {
272 // Show promotion UI because the user either just clicked that button or 266 // Show promotion UI because the user either just clicked that button or
273 // because the user should be able to click it again. 267 // because the user should be able to click it again.
274 show_promote_button_ = true; 268 show_promote_button_ = true;
275 } else { 269 } else {
276 // Show the promote button if promotion is a possibility. 270 // Show the promote button if promotion is a possibility.
277 show_promote_button_ = [keystone_glue wantsPromotion]; 271 show_promote_button_ = [keystone_glue wantsPromotion];
278 } 272 }
279 } 273 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/version_updater_mac.h ('k') | chrome/browser/ui/webui/help/version_updater_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698