[safe-browsing] Database full hash matches like prefix match.
[chromium-blink-merge.git] / chrome / browser / first_run / upgrade_util.h
blob700b2b449306e3248c2fe9361d4f5e84282588ef
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_H_
6 #define CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_H_
8 #include "build/build_config.h"
10 #if defined(OS_WIN)
11 #include <string>
12 #endif
14 #if !defined(OS_CHROMEOS)
16 namespace base {
17 class CommandLine;
20 namespace upgrade_util {
22 // Launches Chrome again simulating a "user" launch. If Chrome could not be
23 // launched, returns false.
24 bool RelaunchChromeBrowser(const base::CommandLine& command_line);
26 #if defined(OS_WIN)
28 extern const char kRelaunchModeMetro[];
29 extern const char kRelaunchModeDesktop[];
30 extern const char kRelaunchModeDefault[];
32 enum RelaunchMode {
33 RELAUNCH_MODE_METRO = 0,
34 RELAUNCH_MODE_DESKTOP = 1,
35 // Default mode indicates caller is not sure which mode to launch.
36 RELAUNCH_MODE_DEFAULT = 2,
39 std::string RelaunchModeEnumToString(const RelaunchMode& relaunch_mode);
41 RelaunchMode RelaunchModeStringToEnum(const std::string& relaunch_mode);
43 // Like RelaunchChromeBrowser() but for Windows 8 it will read pref and restart
44 // chrome accordingly in desktop or metro mode.
45 bool RelaunchChromeWithMode(const base::CommandLine& command_line,
46 const RelaunchMode& relaunch_mode);
48 #endif
50 #if !defined(OS_MACOSX)
52 void SetNewCommandLine(base::CommandLine* new_command_line);
54 // Launches a new instance of the browser if the current instance in persistent
55 // mode an upgrade is detected.
56 void RelaunchChromeBrowserWithNewCommandLineIfNeeded();
58 // Windows:
59 // Checks if chrome_new.exe is present in the current instance's install.
60 // Linux:
61 // Checks if the last modified time of chrome is newer than that of the current
62 // running instance.
63 bool IsUpdatePendingRestart();
65 #endif // !defined(OS_MACOSX)
67 } // namespace upgrade_util
69 #endif // !defined(OS_CHROMEOS)
71 #endif // CHROME_BROWSER_FIRST_RUN_UPGRADE_UTIL_H_