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

Side by Side Diff: chrome/browser/views/about_chrome_view.cc

Issue 42606: Making google update UAC prompt launch in the foreground (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/google_update.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/about_chrome_view.h" 5 #include "chrome/browser/views/about_chrome_view.h"
6 6
7 #include <commdlg.h> 7 #include <commdlg.h>
8 8
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 // work as before - enabling UAC or installing the latest service pack 580 // work as before - enabling UAC or installing the latest service pack
581 // for Vista is another option. 581 // for Vista is another option.
582 int service_pack_major = 0, service_pack_minor = 0; 582 int service_pack_major = 0, service_pack_minor = 0;
583 win_util::GetServicePackLevel(&service_pack_major, &service_pack_minor); 583 win_util::GetServicePackLevel(&service_pack_major, &service_pack_minor);
584 if (win_util::UserAccountControlIsEnabled() || 584 if (win_util::UserAccountControlIsEnabled() ||
585 win_util::GetWinVersion() == win_util::WINVERSION_XP || 585 win_util::GetWinVersion() == win_util::WINVERSION_XP ||
586 (win_util::GetWinVersion() == win_util::WINVERSION_VISTA && 586 (win_util::GetWinVersion() == win_util::WINVERSION_VISTA &&
587 service_pack_major >= 1) || 587 service_pack_major >= 1) ||
588 win_util::GetWinVersion() > win_util::WINVERSION_VISTA) { 588 win_util::GetWinVersion() > win_util::WINVERSION_VISTA) {
589 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR); 589 UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR);
590 google_updater_->CheckForUpdate(false); // false=don't upgrade yet. 590 // CheckForUpdate(false, ...) means don't upgrade yet.
591 google_updater_->CheckForUpdate(false, window());
591 } 592 }
592 } else { 593 } else {
593 parent->RemoveChildView(&update_label_); 594 parent->RemoveChildView(&update_label_);
594 parent->RemoveChildView(throbber_.get()); 595 parent->RemoveChildView(throbber_.get());
595 parent->RemoveChildView(&success_indicator_); 596 parent->RemoveChildView(&success_indicator_);
596 parent->RemoveChildView(&update_available_indicator_); 597 parent->RemoveChildView(&update_available_indicator_);
597 parent->RemoveChildView(&timeout_indicator_); 598 parent->RemoveChildView(&timeout_indicator_);
598 } 599 }
599 } 600 }
600 } 601 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 662
662 bool AboutChromeView::Accept() { 663 bool AboutChromeView::Accept() {
663 UpdateStatus(UPGRADE_STARTED, GOOGLE_UPDATE_NO_ERROR); 664 UpdateStatus(UPGRADE_STARTED, GOOGLE_UPDATE_NO_ERROR);
664 665
665 // The Upgrade button isn't available until we have received notification 666 // The Upgrade button isn't available until we have received notification
666 // that an update is available, at which point this pointer should have been 667 // that an update is available, at which point this pointer should have been
667 // null-ed out. 668 // null-ed out.
668 DCHECK(!google_updater_); 669 DCHECK(!google_updater_);
669 google_updater_ = new GoogleUpdate(); 670 google_updater_ = new GoogleUpdate();
670 google_updater_->AddStatusChangeListener(this); 671 google_updater_->AddStatusChangeListener(this);
671 google_updater_->CheckForUpdate(true); // true=upgrade if new version found. 672 // CheckForUpdate(true,...) means perform the upgrade if new version found.
673 google_updater_->CheckForUpdate(true, window());
672 674
673 return false; // We never allow this button to close the window. 675 return false; // We never allow this button to close the window.
674 } 676 }
675 677
676 views::View* AboutChromeView::GetContentsView() { 678 views::View* AboutChromeView::GetContentsView() {
677 return this; 679 return this;
678 } 680 }
679 681
680 //////////////////////////////////////////////////////////////////////////////// 682 ////////////////////////////////////////////////////////////////////////////////
681 // AboutChromeView, views::LinkController implementation: 683 // AboutChromeView, views::LinkController implementation:
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 812
811 // We have updated controls on the parent, so we need to update its layout. 813 // We have updated controls on the parent, so we need to update its layout.
812 View* parent = GetParent(); 814 View* parent = GetParent();
813 parent->Layout(); 815 parent->Layout();
814 816
815 // Check button may have appeared/disappeared. We cannot call this during 817 // Check button may have appeared/disappeared. We cannot call this during
816 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. 818 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet.
817 if (window()) 819 if (window())
818 GetDialogClientView()->UpdateDialogButtons(); 820 GetDialogClientView()->UpdateDialogButtons();
819 } 821 }
OLDNEW
« no previous file with comments | « chrome/browser/google_update.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698