OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "grit/app_locale_settings.h" | 43 #include "grit/app_locale_settings.h" |
44 #include "grit/chromium_strings.h" | 44 #include "grit/chromium_strings.h" |
45 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
46 #include "installer_util_strings/installer_util_strings.h" | 46 #include "installer_util_strings/installer_util_strings.h" |
47 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
48 #include "ui/base/l10n/l10n_util_win.h" | 48 #include "ui/base/l10n/l10n_util_win.h" |
49 #include "ui/base/ui_base_switches.h" | 49 #include "ui/base/ui_base_switches.h" |
50 #include "ui/base/win/message_box_win.h" | 50 #include "ui/base/win/message_box_win.h" |
51 #include "ui/gfx/platform_font_win.h" | 51 #include "ui/gfx/platform_font_win.h" |
52 | 52 |
53 #if defined(USE_AURA) | |
54 #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" | |
55 #endif | |
56 | |
57 | |
58 namespace { | 53 namespace { |
59 | 54 |
60 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( | 55 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( |
61 const wchar_t* command_line, | 56 const wchar_t* command_line, |
62 DWORD flags); | 57 DWORD flags); |
63 | 58 |
64 void InitializeWindowProcExceptions() { | 59 void InitializeWindowProcExceptions() { |
65 // Get the breakpad pointer from chrome.exe | 60 // Get the breakpad pointer from chrome.exe |
66 base::win::WinProcExceptionFilter exception_filter = | 61 base::win::WinProcExceptionFilter exception_filter = |
67 reinterpret_cast<base::win::WinProcExceptionFilter>( | 62 reinterpret_cast<base::win::WinProcExceptionFilter>( |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 MessageLoopForUI::current()->SetMessageFilter( | 215 MessageLoopForUI::current()->SetMessageFilter( |
221 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); | 216 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); |
222 } | 217 } |
223 } | 218 } |
224 } | 219 } |
225 | 220 |
226 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { | 221 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { |
227 ChromeBrowserMainParts::PreMainMessageLoopRun(); | 222 ChromeBrowserMainParts::PreMainMessageLoopRun(); |
228 | 223 |
229 removable_device_notifications_window_->Init(); | 224 removable_device_notifications_window_->Init(); |
230 | |
231 #if defined(USE_AURA) | |
232 CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
233 if (command_line.HasSwitch(switches::kViewerConnection) && | |
234 !metro_viewer_process_host_) { | |
235 // Tell the metro viewer process host to connect to the given IPC channel. | |
236 metro_viewer_process_host_.reset( | |
237 new MetroViewerProcessHost( | |
238 command_line.GetSwitchValueASCII(switches::kViewerConnection))); | |
239 } | |
240 #endif | |
241 } | 225 } |
242 | 226 |
243 // static | 227 // static |
244 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 228 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
245 const CommandLine& parsed_command_line) { | 229 const CommandLine& parsed_command_line) { |
246 // Clear this var so child processes don't show the dialog by default. | 230 // Clear this var so child processes don't show the dialog by default. |
247 scoped_ptr<base::Environment> env(base::Environment::Create()); | 231 scoped_ptr<base::Environment> env(base::Environment::Create()); |
248 env->UnSetVar(env_vars::kShowRestart); | 232 env->UnSetVar(env_vars::kShowRestart); |
249 | 233 |
250 // For non-interactive tests we don't restart on crash. | 234 // For non-interactive tests we don't restart on crash. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 if (resource_id) | 386 if (resource_id) |
403 return l10n_util::GetStringUTF16(resource_id); | 387 return l10n_util::GetStringUTF16(resource_id); |
404 return string16(); | 388 return string16(); |
405 } | 389 } |
406 | 390 |
407 // static | 391 // static |
408 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 392 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
409 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 393 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
410 installer::SetTranslationDelegate(&delegate); | 394 installer::SetTranslationDelegate(&delegate); |
411 } | 395 } |
OLD | NEW |