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/views/about_chrome_view.h" | 5 #include "chrome/browser/ui/views/about_chrome_view.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <commdlg.h> | 8 #include <commdlg.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 // On-demand updates for Chrome don't work in Vista RTM when UAC is turned | 521 // On-demand updates for Chrome don't work in Vista RTM when UAC is turned |
522 // off. So, in this case we just want the About box to not mention | 522 // off. So, in this case we just want the About box to not mention |
523 // on-demand updates. Silent updates (in the background) should still | 523 // on-demand updates. Silent updates (in the background) should still |
524 // work as before - enabling UAC or installing the latest service pack | 524 // work as before - enabling UAC or installing the latest service pack |
525 // for Vista is another option. | 525 // for Vista is another option. |
526 if (!(base::win::GetVersion() == base::win::VERSION_VISTA && | 526 if (!(base::win::GetVersion() == base::win::VERSION_VISTA && |
527 (base::win::OSInfo::GetInstance()->service_pack().major == 0) && | 527 (base::win::OSInfo::GetInstance()->service_pack().major == 0) && |
528 !base::win::UserAccountControlIsEnabled())) { | 528 !base::win::UserAccountControlIsEnabled())) { |
529 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR, string16()); | 529 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR, string16()); |
530 // CheckForUpdate(false, ...) means don't upgrade yet. | 530 // CheckForUpdate(false, ...) means don't upgrade yet. |
531 google_updater_->CheckForUpdate(false, GetWidget()); | 531 google_updater_->CheckForUpdate(false, GetWidget()->GetNativeWindow()); |
532 } | 532 } |
533 #endif | 533 #endif |
534 } else { | 534 } else { |
535 parent->RemoveChildView(&update_label_); | 535 parent->RemoveChildView(&update_label_); |
536 parent->RemoveChildView(throbber_.get()); | 536 parent->RemoveChildView(throbber_.get()); |
537 parent->RemoveChildView(&success_indicator_); | 537 parent->RemoveChildView(&success_indicator_); |
538 parent->RemoveChildView(&update_available_indicator_); | 538 parent->RemoveChildView(&update_available_indicator_); |
539 parent->RemoveChildView(&timeout_indicator_); | 539 parent->RemoveChildView(&timeout_indicator_); |
540 } | 540 } |
541 } | 541 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 l10n_util::GetStringUTF16(IDS_UPGRADE_CHECK_STARTED)); | 674 l10n_util::GetStringUTF16(IDS_UPGRADE_CHECK_STARTED)); |
675 break; | 675 break; |
676 case UPGRADE_IS_AVAILABLE: | 676 case UPGRADE_IS_AVAILABLE: |
677 content::RecordAction( | 677 content::RecordAction( |
678 UserMetricsAction("UpgradeCheck_UpgradeIsAvailable")); | 678 UserMetricsAction("UpgradeCheck_UpgradeIsAvailable")); |
679 DCHECK(!google_updater_); // Should have been nulled out already. | 679 DCHECK(!google_updater_); // Should have been nulled out already. |
680 google_updater_ = new GoogleUpdate(); | 680 google_updater_ = new GoogleUpdate(); |
681 google_updater_->set_status_listener(this); | 681 google_updater_->set_status_listener(this); |
682 UpdateStatus(UPGRADE_STARTED, GOOGLE_UPDATE_NO_ERROR, string16()); | 682 UpdateStatus(UPGRADE_STARTED, GOOGLE_UPDATE_NO_ERROR, string16()); |
683 // CheckForUpdate(true,...) means perform upgrade if new version found. | 683 // CheckForUpdate(true,...) means perform upgrade if new version found. |
684 google_updater_->CheckForUpdate(true, GetWidget()); | 684 google_updater_->CheckForUpdate(true, GetWidget()->GetNativeWindow()); |
685 // TODO(seanparent): Need to see if this code needs to change to | 685 // TODO(seanparent): Need to see if this code needs to change to |
686 // force a machine restart. | 686 // force a machine restart. |
687 return; | 687 return; |
688 case UPGRADE_ALREADY_UP_TO_DATE: { | 688 case UPGRADE_ALREADY_UP_TO_DATE: { |
689 // The extra version check is necessary on Windows because the application | 689 // The extra version check is necessary on Windows because the application |
690 // may be already up to date on disk though the running app is still | 690 // may be already up to date on disk though the running app is still |
691 // out of date. Chrome OS doesn't quite have this issue since the | 691 // out of date. Chrome OS doesn't quite have this issue since the |
692 // OS/App are updated together. If a newer version of the OS has been | 692 // OS/App are updated together. If a newer version of the OS has been |
693 // staged then UPGRADE_SUCESSFUL will be returned. | 693 // staged then UPGRADE_SUCESSFUL will be returned. |
694 // Google Update reported that Chrome is up-to-date. Now make sure that we | 694 // Google Update reported that Chrome is up-to-date. Now make sure that we |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 int height = error_label_->GetHeightForWidth( | 787 int height = error_label_->GetHeightForWidth( |
788 dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + | 788 dialog_dimensions_.width() - (2 * views::kPanelHorizMargin)) + |
789 views::kRelatedControlVerticalSpacing; | 789 views::kRelatedControlVerticalSpacing; |
790 window_rect.set_height(window_rect.height() + height); | 790 window_rect.set_height(window_rect.height() + height); |
791 GetWidget()->SetBounds(window_rect); | 791 GetWidget()->SetBounds(window_rect); |
792 | 792 |
793 return height; | 793 return height; |
794 } | 794 } |
795 | 795 |
796 #endif | 796 #endif |
OLD | NEW |