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

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

Issue 6243007: Make sure we show the restart message if system level Chrome has been upgrade... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | « no previous file | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 152 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
153 153
154 chrome::VersionInfo version_info; 154 chrome::VersionInfo version_info;
155 if (!version_info.is_valid()) { 155 if (!version_info.is_valid()) {
156 NOTREACHED() << L"Failed to initialize about window"; 156 NOTREACHED() << L"Failed to initialize about window";
157 return; 157 return;
158 } 158 }
159 159
160 current_version_ = version_info.Version(); 160 current_version_ = version_info.Version();
161 161
162 // GetVersionStringModifier hits the registry. See http://crbug.com/69936.
163 base::ThreadRestrictions::ScopedAllowIO allow_io;
162 std::string version_modifier = platform_util::GetVersionStringModifier(); 164 std::string version_modifier = platform_util::GetVersionStringModifier();
163 if (!version_modifier.empty()) 165 if (!version_modifier.empty())
164 version_details_ += " " + version_modifier; 166 version_details_ += " " + version_modifier;
165 167
166 #if !defined(GOOGLE_CHROME_BUILD) 168 #if !defined(GOOGLE_CHROME_BUILD)
167 version_details_ += " ("; 169 version_details_ += " (";
168 version_details_ += version_info.LastChange(); 170 version_details_ += version_info.LastChange();
169 version_details_ += ")"; 171 version_details_ += ")";
170 #endif 172 #endif
171 173
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 // The extra version check is necessary on Windows because the application 747 // The extra version check is necessary on Windows because the application
746 // may be already up to date on disk though the running app is still 748 // may be already up to date on disk though the running app is still
747 // out of date. Chrome OS doesn't quite have this issue since the 749 // out of date. Chrome OS doesn't quite have this issue since the
748 // OS/App are updated together. If a newer version of the OS has been 750 // OS/App are updated together. If a newer version of the OS has been
749 // staged then UPGRADE_SUCESSFUL will be returned. 751 // staged then UPGRADE_SUCESSFUL will be returned.
750 #if defined(OS_WIN) 752 #if defined(OS_WIN)
751 // Google Update reported that Chrome is up-to-date. Now make sure that we 753 // Google Update reported that Chrome is up-to-date. Now make sure that we
752 // are running the latest version and if not, notify the user by falling 754 // are running the latest version and if not, notify the user by falling
753 // into the next case of UPGRADE_SUCCESSFUL. 755 // into the next case of UPGRADE_SUCCESSFUL.
754 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 756 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
757 // GetChromeVersion hits the registry. See http://crbug.com/69936.
758 base::ThreadRestrictions::ScopedAllowIO allow_io;
huanr 2011/01/18 19:30:55 When can UpdateStatus() be called? Does it run in
Finnur 2011/01/18 23:25:30 Nope, this is "About Box"-specific. This code only
huanr 2011/01/18 23:34:22 If we are certain the code only runs when the user
755 scoped_ptr<Version> installed_version( 759 scoped_ptr<Version> installed_version(
756 InstallUtil::GetChromeVersion(dist, false)); 760 InstallUtil::GetChromeVersion(dist, false));
761 if (!installed_version.get()) {
762 // User-level Chrome is not installed, check system-level.
763 installed_version.reset(InstallUtil::GetChromeVersion(dist, true));
764 }
757 scoped_ptr<Version> running_version( 765 scoped_ptr<Version> running_version(
758 Version::GetVersionFromString(current_version_)); 766 Version::GetVersionFromString(current_version_));
759 if (!installed_version.get() || 767 if (!installed_version.get() ||
760 (installed_version->CompareTo(*running_version) <= 0)) { 768 (installed_version->CompareTo(*running_version) <= 0)) {
761 #endif 769 #endif
762 UserMetrics::RecordAction( 770 UserMetrics::RecordAction(
763 UserMetricsAction("UpgradeCheck_AlreadyUpToDate"), profile_); 771 UserMetricsAction("UpgradeCheck_AlreadyUpToDate"), profile_);
764 #if defined(OS_CHROMEOS) 772 #if defined(OS_CHROMEOS)
765 std::wstring update_label_text = UTF16ToWide(l10n_util::GetStringFUTF16( 773 std::wstring update_label_text = UTF16ToWide(l10n_util::GetStringFUTF16(
766 IDS_UPGRADE_ALREADY_UP_TO_DATE, 774 IDS_UPGRADE_ALREADY_UP_TO_DATE,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 View* parent = GetParent(); 833 View* parent = GetParent();
826 parent->Layout(); 834 parent->Layout();
827 835
828 // Check button may have appeared/disappeared. We cannot call this during 836 // Check button may have appeared/disappeared. We cannot call this during
829 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet. 837 // ViewHierarchyChanged because the |window()| pointer hasn't been set yet.
830 if (window()) 838 if (window())
831 GetDialogClientView()->UpdateDialogButtons(); 839 GetDialogClientView()->UpdateDialogButtons();
832 } 840 }
833 841
834 #endif 842 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698