1 // Copyright (c) 2012 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 // Contains functions used by BrowserMain() that are win32-specific.
7 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_
8 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_
10 #include "chrome/browser/chrome_browser_main.h"
14 // Handle uninstallation when given the appropriate the command-line switch.
15 // If |chrome_still_running| is true a modal dialog will be shown asking the
16 // user to close the other chrome instance.
17 int DoUninstallTasks(bool chrome_still_running
);
19 class ChromeBrowserMainPartsWin
: public ChromeBrowserMainParts
{
21 explicit ChromeBrowserMainPartsWin(
22 const content::MainFunctionParams
& parameters
);
24 virtual ~ChromeBrowserMainPartsWin();
26 // BrowserParts overrides.
27 virtual void ToolkitInitialized() OVERRIDE
;
28 virtual void PreMainMessageLoopStart() OVERRIDE
;
29 virtual int PreCreateThreads() OVERRIDE
;
31 // ChromeBrowserMainParts overrides.
32 virtual void ShowMissingLocaleMessageBox() OVERRIDE
;
33 virtual void PostBrowserStart() OVERRIDE
;
35 // Prepares the localized strings that are going to be displayed to
36 // the user if the browser process dies. These strings are stored in the
37 // environment block so they are accessible in the early stages of the
38 // chrome executable's lifetime.
39 static void PrepareRestartOnCrashEnviroment(
40 const CommandLine
& parsed_command_line
);
42 // Registers Chrome with the Windows Restart Manager, which will restore the
43 // Chrome session when the computer is restarted after a system update.
44 static void RegisterApplicationRestart(
45 const CommandLine
& parsed_command_line
);
47 // This method handles the --hide-icons and --show-icons command line options
48 // for chrome that get triggered by Windows from registry entries
49 // HideIconsCommand & ShowIconsCommand. Chrome doesn't support hide icons
50 // functionality so we just ask the users if they want to uninstall Chrome.
51 static int HandleIconsCommands(const CommandLine
& parsed_command_line
);
53 // Check if there is any machine level Chrome installed on the current
54 // machine. If yes and the current Chrome process is user level, we do not
55 // allow the user level Chrome to run. So we notify the user and uninstall
57 static bool CheckMachineLevelInstall();
59 // Sets the TranslationDelegate which provides localized strings to
61 static void SetupInstallerUtilStrings();
64 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsWin
);
67 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_