- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chrome_browser_main_win.h
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.
4
5 // Contains functions used by BrowserMain() that are win32-specific.
6
7 #ifndef CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_
8 #define CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_
9
10 #include "chrome/browser/chrome_browser_main.h"
11
12 class CommandLine;
13
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);
18
19 class ChromeBrowserMainPartsWin : public ChromeBrowserMainParts {
20  public:
21   explicit ChromeBrowserMainPartsWin(
22       const content::MainFunctionParams& parameters);
23
24   virtual ~ChromeBrowserMainPartsWin();
25
26   // BrowserParts overrides.
27   virtual void ToolkitInitialized() OVERRIDE;
28   virtual void PreMainMessageLoopStart() OVERRIDE;
29   virtual int PreCreateThreads() OVERRIDE;
30
31   // ChromeBrowserMainParts overrides.
32   virtual void ShowMissingLocaleMessageBox() OVERRIDE;
33   virtual void PostBrowserStart() OVERRIDE;
34
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);
41
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);
46
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);
52
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
56   // user level Chrome.
57   static bool CheckMachineLevelInstall();
58
59   // Sets the TranslationDelegate which provides localized strings to
60   // installer_util.
61   static void SetupInstallerUtilStrings();
62
63  private:
64   DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsWin);
65 };
66
67 #endif  // CHROME_BROWSER_CHROME_BROWSER_MAIN_WIN_H_