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"
18 // Handle uninstallation when given the appropriate the command-line switch.
19 // If |chrome_still_running| is true a modal dialog will be shown asking the
20 // user to close the other chrome instance.
21 int DoUninstallTasks(bool chrome_still_running
);
23 class ChromeBrowserMainPartsWin
: public ChromeBrowserMainParts
{
25 explicit ChromeBrowserMainPartsWin(
26 const content::MainFunctionParams
& parameters
);
28 virtual ~ChromeBrowserMainPartsWin();
30 // BrowserParts overrides.
31 virtual void ToolkitInitialized() override
;
32 virtual void PreMainMessageLoopStart() override
;
33 virtual int PreCreateThreads() override
;
35 // ChromeBrowserMainParts overrides.
36 virtual void ShowMissingLocaleMessageBox() override
;
37 virtual void PostProfileInit() override
;
38 virtual void PostBrowserStart() override
;
40 // Prepares the localized strings that are going to be displayed to
41 // the user if the browser process dies. These strings are stored in the
42 // environment block so they are accessible in the early stages of the
43 // chrome executable's lifetime.
44 static void PrepareRestartOnCrashEnviroment(
45 const base::CommandLine
& parsed_command_line
);
47 // Registers Chrome with the Windows Restart Manager, which will restore the
48 // Chrome session when the computer is restarted after a system update.
49 static void RegisterApplicationRestart(
50 const base::CommandLine
& parsed_command_line
);
52 // This method handles the --hide-icons and --show-icons command line options
53 // for chrome that get triggered by Windows from registry entries
54 // HideIconsCommand & ShowIconsCommand. Chrome doesn't support hide icons
55 // functionality so we just ask the users if they want to uninstall Chrome.
56 static int HandleIconsCommands(const base::CommandLine
& parsed_command_line
);
58 // Check if there is any machine level Chrome installed on the current
59 // machine. If yes and the current Chrome process is user level, we do not
60 // allow the user level Chrome to run. So we notify the user and uninstall
62 static bool CheckMachineLevelInstall();
64 // Sets the TranslationDelegate which provides localized strings to
66 static void SetupInstallerUtilStrings();
69 #if defined(GOOGLE_CHROME_BUILD)
70 scoped_ptr
<DidRunUpdater
> did_run_updater_
;
73 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsWin
);
76 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_