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

Unified Diff: chrome/browser/first_run/upgrade_util_linux.cc

Issue 6840003: first-run: Refactor Upgrade class into a common upgrade_util API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upgrade_utils -> upgrade_util Created 9 years, 8 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
« no previous file with comments | « chrome/browser/first_run/upgrade_util.cc ('k') | chrome/browser/first_run/upgrade_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/upgrade_util_linux.cc
diff --git a/chrome/browser/first_run/upgrade_gtk.cc b/chrome/browser/first_run/upgrade_util_linux.cc
similarity index 54%
rename from chrome/browser/first_run/upgrade_gtk.cc
rename to chrome/browser/first_run/upgrade_util_linux.cc
index 419e58f0bd045f14a4dbeb1d1a7ecf6e3cbe52f3..6c3fb88c08aeda373fb6a6b1dcfde78caa191df3 100644
--- a/chrome/browser/first_run/upgrade_gtk.cc
+++ b/chrome/browser/first_run/upgrade_util_linux.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/first_run/upgrade.h"
+#include "chrome/browser/first_run/upgrade_util.h"
#include "base/base_paths.h"
#include "base/command_line.h"
@@ -13,43 +13,39 @@
#include "base/platform_file.h"
#include "base/process_util.h"
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
-// static
-CommandLine* Upgrade::new_command_line_ = NULL;
+namespace {
-// static
-double Upgrade::saved_last_modified_time_of_exe_ = 0;
+double saved_last_modified_time_of_exe = 0;
-// static
-bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) {
+} // namespace
+
+namespace upgrade_util {
+
+bool RelaunchChromeBrowser(const CommandLine& command_line) {
return base::LaunchApp(command_line, false, false, NULL);
}
-// static
-void Upgrade::SaveLastModifiedTimeOfExe() {
- saved_last_modified_time_of_exe_ = Upgrade::GetLastModifiedTimeOfExe();
+bool IsUpdatePendingRestart() {
+ return saved_last_modified_time_of_exe != GetLastModifiedTimeOfExe();
}
-// static
-bool Upgrade::IsUpdatePendingRestart() {
- return saved_last_modified_time_of_exe_ !=
- Upgrade::GetLastModifiedTimeOfExe();
+void SaveLastModifiedTimeOfExe() {
+ saved_last_modified_time_of_exe = GetLastModifiedTimeOfExe();
}
-// static
-double Upgrade::GetLastModifiedTimeOfExe() {
+double GetLastModifiedTimeOfExe() {
FilePath exe_file_path;
if (!PathService::Get(base::FILE_EXE, &exe_file_path)) {
LOG(WARNING) << "Failed to get FilePath object for FILE_EXE.";
- return saved_last_modified_time_of_exe_;
+ return saved_last_modified_time_of_exe;
}
base::PlatformFileInfo exe_file_info;
if (!file_util::GetFileInfo(exe_file_path, &exe_file_info)) {
LOG(WARNING) << "Failed to get FileInfo object for FILE_EXE - "
<< exe_file_path.value();
- return saved_last_modified_time_of_exe_;
+ return saved_last_modified_time_of_exe;
}
return exe_file_info.last_modified.ToDoubleT();
}
-#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
+} // namespace upgrade_util
« no previous file with comments | « chrome/browser/first_run/upgrade_util.cc ('k') | chrome/browser/first_run/upgrade_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698