OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/about_window_controller.h" | 5 #import "chrome/browser/cocoa/about_window_controller.h" |
6 | 6 |
7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| 11 #include "base/string_number_conversions.h" |
11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
12 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
13 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
14 #include "chrome/browser/platform_util.h" | 15 #include "chrome/browser/platform_util.h" |
15 #import "chrome/browser/cocoa/background_tile_view.h" | 16 #import "chrome/browser/cocoa/background_tile_view.h" |
16 #import "chrome/browser/cocoa/keystone_glue.h" | 17 #import "chrome/browser/cocoa/keystone_glue.h" |
17 #include "chrome/browser/cocoa/restart_browser.h" | 18 #include "chrome/browser/cocoa/restart_browser.h" |
18 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
19 #include "grit/chromium_strings.h" | 20 #include "grit/chromium_strings.h" |
20 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 // re-entered shortly with kAutoupdateChecking. | 446 // re-entered shortly with kAutoupdateChecking. |
446 [self checkForUpdate]; | 447 [self checkForUpdate]; |
447 return; | 448 return; |
448 } | 449 } |
449 | 450 |
450 // Nothing actually failed, but updates aren't possible. The throbber | 451 // Nothing actually failed, but updates aren't possible. The throbber |
451 // and message are hidden, but they'll be reset to these dummy values | 452 // and message are hidden, but they'll be reset to these dummy values |
452 // just to get the throbber to stop spinning if it's running. | 453 // just to get the throbber to stop spinning if it's running. |
453 imageID = IDR_UPDATE_FAIL; | 454 imageID = IDR_UPDATE_FAIL; |
454 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, | 455 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, |
455 IntToString16(status)); | 456 base::IntToString16(status)); |
456 | 457 |
457 break; | 458 break; |
458 | 459 |
459 case kAutoupdateChecking: | 460 case kAutoupdateChecking: |
460 throbber = true; | 461 throbber = true; |
461 message = l10n_util::GetNSStringWithFixup(IDS_UPGRADE_CHECK_STARTED); | 462 message = l10n_util::GetNSStringWithFixup(IDS_UPGRADE_CHECK_STARTED); |
462 enablePromoteButton = false; | 463 enablePromoteButton = false; |
463 | 464 |
464 break; | 465 break; |
465 | 466 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // re-entered shortly with kAutoupdateChecking. | 544 // re-entered shortly with kAutoupdateChecking. |
544 [self checkForUpdate]; | 545 [self checkForUpdate]; |
545 return; | 546 return; |
546 } | 547 } |
547 | 548 |
548 // Nothing actually failed, but updates aren't possible. The throbber | 549 // Nothing actually failed, but updates aren't possible. The throbber |
549 // and message are hidden, but they'll be reset to these dummy values | 550 // and message are hidden, but they'll be reset to these dummy values |
550 // just to get the throbber to stop spinning if it's running. | 551 // just to get the throbber to stop spinning if it's running. |
551 imageID = IDR_UPDATE_FAIL; | 552 imageID = IDR_UPDATE_FAIL; |
552 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, | 553 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, |
553 IntToString16(status)); | 554 base::IntToString16(status)); |
554 | 555 |
555 break; | 556 break; |
556 | 557 |
557 case kAutoupdateRegisterFailed: | 558 case kAutoupdateRegisterFailed: |
558 imageID = IDR_UPDATE_FAIL; | 559 imageID = IDR_UPDATE_FAIL; |
559 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, | 560 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, |
560 IntToString16(status)); | 561 base::IntToString16(status)); |
561 enablePromoteButton = false; | 562 enablePromoteButton = false; |
562 | 563 |
563 break; | 564 break; |
564 | 565 |
565 case kAutoupdateCheckFailed: | 566 case kAutoupdateCheckFailed: |
566 imageID = IDR_UPDATE_FAIL; | 567 imageID = IDR_UPDATE_FAIL; |
567 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, | 568 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, |
568 IntToString16(status)); | 569 base::IntToString16(status)); |
569 | 570 |
570 break; | 571 break; |
571 | 572 |
572 case kAutoupdateInstallFailed: | 573 case kAutoupdateInstallFailed: |
573 recentShownUserActionFailedStatus = YES; | 574 recentShownUserActionFailedStatus = YES; |
574 | 575 |
575 imageID = IDR_UPDATE_FAIL; | 576 imageID = IDR_UPDATE_FAIL; |
576 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, | 577 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, |
577 IntToString16(status)); | 578 base::IntToString16(status)); |
578 | 579 |
579 // Allow another chance. | 580 // Allow another chance. |
580 enableUpdateButton = true; | 581 enableUpdateButton = true; |
581 | 582 |
582 break; | 583 break; |
583 | 584 |
584 case kAutoupdatePromoteFailed: | 585 case kAutoupdatePromoteFailed: |
585 recentShownUserActionFailedStatus = YES; | 586 recentShownUserActionFailedStatus = YES; |
586 | 587 |
587 imageID = IDR_UPDATE_FAIL; | 588 imageID = IDR_UPDATE_FAIL; |
588 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, | 589 message = l10n_util::GetNSStringFWithFixup(IDS_UPGRADE_ERROR, |
589 IntToString16(status)); | 590 base::IntToString16(status)); |
590 | 591 |
591 break; | 592 break; |
592 | 593 |
593 default: | 594 default: |
594 NOTREACHED(); | 595 NOTREACHED(); |
595 | 596 |
596 return; | 597 return; |
597 } | 598 } |
598 | 599 |
599 if (updateMessage) { | 600 if (updateMessage) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 NSRange string_range = NSMakeRange(0, [legal_block length]); | 751 NSRange string_range = NSMakeRange(0, [legal_block length]); |
751 [legal_block addAttribute:NSFontAttributeName | 752 [legal_block addAttribute:NSFontAttributeName |
752 value:[NSFont labelFontOfSize:11] | 753 value:[NSFont labelFontOfSize:11] |
753 range:string_range]; | 754 range:string_range]; |
754 | 755 |
755 [legal_block endEditing]; | 756 [legal_block endEditing]; |
756 return legal_block; | 757 return legal_block; |
757 } | 758 } |
758 | 759 |
759 @end // @implementation AboutWindowController | 760 @end // @implementation AboutWindowController |
OLD | NEW |