Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 8302016: Make GTK and Aura parts orthogonal to OS parts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index 711193c7ccbeab1eb649f8f7994ca3bd7befb9d2..a04cdabb733e0fbe2b42a465a6b9457d7c13a358 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -74,14 +74,6 @@ void WarnAboutMinimumSystemRequirements() {
}
}
-#if !defined(USE_AURA)
-void ShowMissingLocaleMessageBox() {
- ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage),
- ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle),
- MB_OK | MB_ICONERROR | MB_TOPMOST);
-}
-#endif
-
void RecordBrowserStartupTime() {
// Calculate the time that has elapsed from our own process creation.
FILETIME creation_time = {};
@@ -141,11 +133,25 @@ int DoUninstallTasks(bool chrome_still_running) {
return ret;
}
+// ChromeBrowserMainPartsWin ---------------------------------------------------
+
+ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin(
+ const MainFunctionParams& parameters)
+ : ChromeBrowserMainParts(parameters) {
+}
+
+void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() {
+ if (!parameters().ui_task) {
+ // Make sure that we know how to handle exceptions from the message loop.
+ InitializeWindowProcExceptions();
+ }
+}
+
// Prepares the localized strings that are going to be displayed to
// the user if the browser process dies. These strings are stored in the
// environment block so they are accessible in the early stages of the
// chrome executable's lifetime.
-void PrepareRestartOnCrashEnviroment(const CommandLine& parsed_command_line) {
+void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment() {
// Clear this var so child processes don't show the dialog by default.
scoped_ptr<base::Environment> env(base::Environment::Create());
env->UnSetVar(env_vars::kShowRestart);
@@ -156,9 +162,9 @@ void PrepareRestartOnCrashEnviroment(const CommandLine& parsed_command_line) {
// If the known command-line test options are used we don't create the
// environment block which means we don't get the restart dialog.
- if (parsed_command_line.HasSwitch(switches::kBrowserCrashTest) ||
- parsed_command_line.HasSwitch(switches::kBrowserAssertTest) ||
- parsed_command_line.HasSwitch(switches::kNoErrorDialogs))
+ if (parsed_command_line().HasSwitch(switches::kBrowserCrashTest) ||
+ parsed_command_line().HasSwitch(switches::kBrowserAssertTest) ||
+ parsed_command_line().HasSwitch(switches::kNoErrorDialogs))
return;
// The encoding we use for the info is "title|context|direction" where
@@ -177,7 +183,7 @@ void PrepareRestartOnCrashEnviroment(const CommandLine& parsed_command_line) {
env->SetVar(env_vars::kRestartInfo, UTF16ToUTF8(dlg_strings));
}
-void RegisterApplicationRestart(const CommandLine& parsed_command_line) {
+void ChromeBrowserMainPartsWin::RegisterApplicationRestart() {
DCHECK(base::win::GetVersion() >= base::win::VERSION_VISTA);
base::ScopedNativeLibrary library(FilePath(L"kernel32.dll"));
// Get the function pointer for RegisterApplicationRestart.
@@ -191,7 +197,7 @@ void RegisterApplicationRestart(const CommandLine& parsed_command_line) {
// The Windows Restart Manager expects a string of command line flags only,
// without the program.
CommandLine command_line(CommandLine::NO_PROGRAM);
- command_line.AppendArguments(parsed_command_line, false);
+ command_line.AppendArguments(parsed_command_line(), false);
if (!command_line.HasSwitch(switches::kRestoreLastSession))
command_line.AppendSwitch(switches::kRestoreLastSession);
if (command_line.GetCommandLineString().length() > RESTART_MAX_CMD_LINE) {
@@ -207,12 +213,18 @@ void RegisterApplicationRestart(const CommandLine& parsed_command_line) {
DCHECK(SUCCEEDED(hr)) << "RegisterApplicationRestart failed.";
}
+void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() {
+ ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage),
+ ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle),
+ MB_OK | MB_ICONERROR | MB_TOPMOST);
+}
+
// This method handles the --hide-icons and --show-icons command line options
// for chrome that get triggered by Windows from registry entries
// HideIconsCommand & ShowIconsCommand. Chrome doesn't support hide icons
// functionality so we just ask the users if they want to uninstall Chrome.
-int HandleIconsCommands(const CommandLine& parsed_command_line) {
- if (parsed_command_line.HasSwitch(switches::kHideIcons)) {
+int ChromeBrowserMainPartsWin::HandleIconsCommands() {
+ if (parsed_command_line().HasSwitch(switches::kHideIcons)) {
string16 cp_applet;
base::win::Version version = base::win::GetVersion();
if (version >= base::win::VERSION_VISTA) {
@@ -241,7 +253,7 @@ int HandleIconsCommands(const CommandLine& parsed_command_line) {
// machine. If yes and the current Chrome process is user level, we do not
// allow the user level Chrome to run. So we notify the user and uninstall
// user level Chrome.
-bool CheckMachineLevelInstall() {
+bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() {
// TODO(tommi): Check if using the default distribution is always the right
// thing to do.
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
@@ -270,17 +282,3 @@ bool CheckMachineLevelInstall() {
}
return false;
}
-
-// ChromeBrowserMainPartsWin ---------------------------------------------------
-
-ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin(
- const MainFunctionParams& parameters)
- : ChromeBrowserMainParts(parameters) {
-}
-
-void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() {
- if (!parameters().ui_task) {
- // Make sure that we know how to handle exceptions from the message loop.
- InitializeWindowProcExceptions();
- }
-}

Powered by Google App Engine
This is Rietveld 408576698