Fix sorting issues in chrome_browser.gypi restructuring
[chromium-blink-merge.git] / chrome / browser / chrome_browser_main_win.h
blob3b3ea04db29623f3c6670edff26698f45243ffa4
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"
12 class DidRunUpdater;
14 namespace base {
15 class CommandLine;
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 {
24 public:
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 PostBrowserStart() override;
39 // Prepares the localized strings that are going to be displayed to
40 // the user if the browser process dies. These strings are stored in the
41 // environment block so they are accessible in the early stages of the
42 // chrome executable's lifetime.
43 static void PrepareRestartOnCrashEnviroment(
44 const base::CommandLine& parsed_command_line);
46 // Registers Chrome with the Windows Restart Manager, which will restore the
47 // Chrome session when the computer is restarted after a system update.
48 static void RegisterApplicationRestart(
49 const base::CommandLine& parsed_command_line);
51 // This method handles the --hide-icons and --show-icons command line options
52 // for chrome that get triggered by Windows from registry entries
53 // HideIconsCommand & ShowIconsCommand. Chrome doesn't support hide icons
54 // functionality so we just ask the users if they want to uninstall Chrome.
55 static int HandleIconsCommands(const base::CommandLine& parsed_command_line);
57 // Check if there is any machine level Chrome installed on the current
58 // machine. If yes and the current Chrome process is user level, we do not
59 // allow the user level Chrome to run. So we notify the user and uninstall
60 // user level Chrome.
61 static bool CheckMachineLevelInstall();
63 // Sets the TranslationDelegate which provides localized strings to
64 // installer_util.
65 static void SetupInstallerUtilStrings();
67 private:
68 #if defined(GOOGLE_CHROME_BUILD)
69 scoped_ptr<DidRunUpdater> did_run_updater_;
70 #endif
72 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsWin);
75 #endif // CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_