diff options
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r-- | chrome/browser/first_run/upgrade_util.h | 34 | ||||
-rw-r--r-- | chrome/browser/first_run/upgrade_util_linux.cc | 1 | ||||
-rw-r--r-- | chrome/browser/first_run/upgrade_util_linux.h | 19 | ||||
-rw-r--r-- | chrome/browser/first_run/upgrade_util_win.cc | 3 | ||||
-rw-r--r-- | chrome/browser/first_run/upgrade_util_win.h | 34 |
5 files changed, 55 insertions, 36 deletions
diff --git a/chrome/browser/first_run/upgrade_util.h b/chrome/browser/first_run/upgrade_util.h index 322073c..89302b2 100644 --- a/chrome/browser/first_run/upgrade_util.h +++ b/chrome/browser/first_run/upgrade_util.h @@ -6,14 +6,8 @@ #define CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_H_ #pragma once -#include "build/build_config.h" - class CommandLine; -#if defined(OS_WIN) -class ProcessSingleton; -#endif - namespace upgrade_util { void SetNewCommandLine(CommandLine* new_command_line); @@ -33,34 +27,6 @@ bool RelaunchChromeBrowser(const CommandLine& command_line); // running instance. bool IsUpdatePendingRestart(); -#if defined(OS_WIN) -// Check if current chrome.exe is already running as a browser process by -// trying to create a Global event with name same as full path of chrome.exe. -// This method caches the handle to this event so on subsequent calls also -// it can first close the handle and check for any other process holding the -// handle to the event. -bool IsBrowserAlreadyRunning(); - -// If the new_chrome.exe exists (placed by the installer then is swapped -// to chrome.exe and the old chrome is renamed to old_chrome.exe. If there -// is no new_chrome.exe or the swap fails the return is false; -bool SwapNewChromeExeIfPresent(); - -// Combines the two methods, RelaunchChromeBrowser and -// SwapNewChromeExeIfPresent, to perform the rename and relaunch of -// the browser. Note that relaunch does NOT exit the existing browser process. -// If this is called before message loop is executed, simply exit the main -// function. If browser is already running, you will need to exit it. -bool DoUpgradeTasks(const CommandLine& command_line); - -#endif // OS_WIN - -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) -void SaveLastModifiedTimeOfExe(); - -double GetLastModifiedTimeOfExe(); -#endif - } // namespace upgrade_util #endif // CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_H_ diff --git a/chrome/browser/first_run/upgrade_util_linux.cc b/chrome/browser/first_run/upgrade_util_linux.cc index 6c3fb88..6384c38 100644 --- a/chrome/browser/first_run/upgrade_util_linux.cc +++ b/chrome/browser/first_run/upgrade_util_linux.cc @@ -12,6 +12,7 @@ #include "base/path_service.h" #include "base/platform_file.h" #include "base/process_util.h" +#include "chrome/browser/first_run/upgrade_util_linux.h" namespace { diff --git a/chrome/browser/first_run/upgrade_util_linux.h b/chrome/browser/first_run/upgrade_util_linux.h new file mode 100644 index 0000000..8afff07 --- /dev/null +++ b/chrome/browser/first_run/upgrade_util_linux.h @@ -0,0 +1,19 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_LINUX_H_ +#define CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_LINUX_H_ +#pragma once + +namespace upgrade_util { + +// Saves the last modified time of the chrome executable file. +void SaveLastModifiedTimeOfExe(); + +// Returns the last modified time of the chrome executable file. +double GetLastModifiedTimeOfExe(); + +} // namespace upgrade_util + +#endif // CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_LINUX_H_ diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc index 316eecc..7789a2e 100644 --- a/chrome/browser/first_run/upgrade_util_win.cc +++ b/chrome/browser/first_run/upgrade_util_win.cc @@ -17,8 +17,7 @@ #include "base/process_util.h" #include "base/win/registry.h" #include "base/win/scoped_comptr.h" -#include "chrome/browser/first_run/try_chrome_dialog_view.h" -#include "chrome/browser/process_singleton.h" +#include "chrome/browser/first_run/upgrade_util_win.h" #include "chrome/common/chrome_constants.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" diff --git a/chrome/browser/first_run/upgrade_util_win.h b/chrome/browser/first_run/upgrade_util_win.h new file mode 100644 index 0000000..da63aaa --- /dev/null +++ b/chrome/browser/first_run/upgrade_util_win.h @@ -0,0 +1,34 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_WIN_H_ +#define CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_WIN_H_ +#pragma once + +class CommandLine; + +namespace upgrade_util { + +// Check if current chrome.exe is already running as a browser process by +// trying to create a Global event with name same as full path of chrome.exe. +// This method caches the handle to this event so on subsequent calls also +// it can first close the handle and check for any other process holding the +// handle to the event. +bool IsBrowserAlreadyRunning(); + +// If the new_chrome.exe exists (placed by the installer then is swapped +// to chrome.exe and the old chrome is renamed to old_chrome.exe. If there +// is no new_chrome.exe or the swap fails the return is false; +bool SwapNewChromeExeIfPresent(); + +// Combines the two methods, RelaunchChromeBrowser and +// SwapNewChromeExeIfPresent, to perform the rename and relaunch of +// the browser. Note that relaunch does NOT exit the existing browser process. +// If this is called before message loop is executed, simply exit the main +// function. If browser is already running, you will need to exit it. +bool DoUpgradeTasks(const CommandLine& command_line); + +} // namespace upgrade_util + +#endif // CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_WIN_H_ |