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
;
34 // Prepares the localized strings that are going to be displayed to
35 // the user if the browser process dies. These strings are stored in the
36 // environment block so they are accessible in the early stages of the
37 // chrome executable's lifetime.
38 static void PrepareRestartOnCrashEnviroment(
39 const CommandLine
& parsed_command_line
);
41 // Registers Chrome with the Windows Restart Manager, which will restore the
42 // Chrome session when the computer is restarted after a system update.
43 static void RegisterApplicationRestart(
44 const CommandLine
& parsed_command_line
);
46 // This method handles the --hide-icons and --show-icons command line options
47 // for chrome that get triggered by Windows from registry entries
48 // HideIconsCommand & ShowIconsCommand. Chrome doesn't support hide icons
49 // functionality so we just ask the users if they want to uninstall Chrome.
50 static int HandleIconsCommands(const CommandLine
& parsed_command_line
);
52 // Check if there is any machine level Chrome installed on the current
53 // machine. If yes and the current Chrome process is user level, we do not
54 // allow the user level Chrome to run. So we notify the user and uninstall
56 static bool CheckMachineLevelInstall();
58 // Sets the TranslationDelegate which provides localized strings to
60 static void SetupInstallerUtilStrings();
63 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsWin
);
66 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_