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

Unified Diff: chrome/browser/ui/webui/help/version_updater_mac.mm

Issue 334653006: mac: Prevent Address Book permissions dialog from erroneously appearing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add metrics. Note the addition of histograms.xml Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/help/version_updater_mac.mm
diff --git a/chrome/browser/ui/webui/help/version_updater_mac.mm b/chrome/browser/ui/webui/help/version_updater_mac.mm
index 56586d36d7a2a9627008aac2579ed67afe6abf9c..d0958c59ae878b8880862fe3ee4d3f6a8e4d5543 100644
--- a/chrome/browser/ui/webui/help/version_updater_mac.mm
+++ b/chrome/browser/ui/webui/help/version_updater_mac.mm
@@ -76,10 +76,11 @@ void VersionUpdaterMac::CheckForUpdate(
KeystoneGlue* keystone_glue = [KeystoneGlue defaultKeystoneGlue];
if (keystone_glue && ![keystone_glue isOnReadOnlyFilesystem]) {
- AutoupdateStatus recent_status = [keystone_glue recentStatus];
+ keystone_glue::AutoupdateStatus recent_status =
+ [keystone_glue recentStatus];
if ([keystone_glue asyncOperationPending] ||
- recent_status == kAutoupdateRegisterFailed ||
- recent_status == kAutoupdateNeedsPromotion) {
+ recent_status == keystone_glue::kAutoupdateRegisterFailed ||
+ recent_status == keystone_glue::kAutoupdateNeedsPromotion) {
// If an asynchronous update operation is currently pending, such as a
// check for updates or an update installation attempt, set the status
// up correspondingly without launching a new update check.
@@ -130,48 +131,49 @@ void VersionUpdaterMac::RelaunchBrowser() const {
}
void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) {
- AutoupdateStatus keystone_status = static_cast<AutoupdateStatus>(
- [[dictionary objectForKey:kAutoupdateStatusStatus] intValue]);
+ keystone_glue::AutoupdateStatus keystone_status =
+ static_cast<keystone_glue::AutoupdateStatus>(
+ [[dictionary objectForKey:kAutoupdateStatusStatus] intValue]);
bool enable_promote_button = true;
base::string16 message;
Status status;
switch (keystone_status) {
- case kAutoupdateRegistering:
- case kAutoupdateChecking:
+ case keystone_glue::kAutoupdateRegistering:
+ case keystone_glue::kAutoupdateChecking:
status = CHECKING;
enable_promote_button = false;
break;
- case kAutoupdateRegistered:
- case kAutoupdatePromoted:
+ case keystone_glue::kAutoupdateRegistered:
+ case keystone_glue::kAutoupdatePromoted:
UpdateShowPromoteButton();
// Go straight into an update check. Return immediately, this routine
// will be re-entered shortly with kAutoupdateChecking.
[[KeystoneGlue defaultKeystoneGlue] checkForUpdate];
return;
- case kAutoupdateCurrent:
+ case keystone_glue::kAutoupdateCurrent:
status = UPDATED;
break;
- case kAutoupdateAvailable:
+ case keystone_glue::kAutoupdateAvailable:
// Install the update automatically. Return immediately, this routine
// will be re-entered shortly with kAutoupdateInstalling.
[[KeystoneGlue defaultKeystoneGlue] installUpdate];
return;
- case kAutoupdateInstalling:
+ case keystone_glue::kAutoupdateInstalling:
status = UPDATING;
enable_promote_button = false;
break;
- case kAutoupdateInstalled:
+ case keystone_glue::kAutoupdateInstalled:
status = NEARLY_UPDATED;
break;
- case kAutoupdatePromoting:
+ case keystone_glue::kAutoupdatePromoting:
#if 1
// TODO(mark): KSRegistration currently handles the promotion
// synchronously, meaning that the main thread's loop doesn't spin,
@@ -186,19 +188,18 @@ void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) {
enable_promote_button = false;
break;
- case kAutoupdateRegisterFailed:
+ case keystone_glue::kAutoupdateRegisterFailed:
enable_promote_button = false;
// Fall through.
- case kAutoupdateCheckFailed:
- case kAutoupdateInstallFailed:
- case kAutoupdatePromoteFailed:
+ case keystone_glue::kAutoupdateCheckFailed:
+ case keystone_glue::kAutoupdateInstallFailed:
+ case keystone_glue::kAutoupdatePromoteFailed:
status = FAILED;
message = l10n_util::GetStringFUTF16Int(IDS_UPGRADE_ERROR,
keystone_status);
break;
- case kAutoupdateNeedsPromotion:
- {
+ case keystone_glue::kAutoupdateNeedsPromotion: {
status = FAILED;
base::string16 product_name =
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
@@ -232,14 +233,14 @@ void VersionUpdaterMac::UpdateShowPromoteButton() {
}
KeystoneGlue* keystone_glue = [KeystoneGlue defaultKeystoneGlue];
- AutoupdateStatus recent_status = [keystone_glue recentStatus];
- if (recent_status == kAutoupdateRegistering ||
- recent_status == kAutoupdateRegisterFailed ||
- recent_status == kAutoupdatePromoted) {
+ keystone_glue::AutoupdateStatus recent_status = [keystone_glue recentStatus];
+ if (recent_status == keystone_glue::kAutoupdateRegistering ||
+ recent_status == keystone_glue::kAutoupdateRegisterFailed ||
+ recent_status == keystone_glue::kAutoupdatePromoted) {
// Promotion isn't possible at this point.
show_promote_button_ = false;
- } else if (recent_status == kAutoupdatePromoting ||
- recent_status == kAutoupdatePromoteFailed) {
+ } else if (recent_status == keystone_glue::kAutoupdatePromoting ||
+ recent_status == keystone_glue::kAutoupdatePromoteFailed) {
// Show promotion UI because the user either just clicked that button or
// because the user should be able to click it again.
show_promote_button_ = true;

Powered by Google App Engine
This is Rietveld 408576698