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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "grit/app_locale_settings.h" | 42 #include "grit/app_locale_settings.h" |
43 #include "grit/chromium_strings.h" | 43 #include "grit/chromium_strings.h" |
44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
45 #include "installer_util_strings/installer_util_strings.h" | 45 #include "installer_util_strings/installer_util_strings.h" |
46 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
47 #include "ui/base/l10n/l10n_util_win.h" | 47 #include "ui/base/l10n/l10n_util_win.h" |
48 #include "ui/base/ui_base_switches.h" | 48 #include "ui/base/ui_base_switches.h" |
49 #include "ui/base/win/message_box_win.h" | 49 #include "ui/base/win/message_box_win.h" |
50 #include "ui/gfx/platform_font_win.h" | 50 #include "ui/gfx/platform_font_win.h" |
51 | 51 |
| 52 #if defined(USE_AURA) |
| 53 #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" |
| 54 #endif |
| 55 |
52 | 56 |
53 namespace { | 57 namespace { |
54 | 58 |
55 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( | 59 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( |
56 const wchar_t* command_line, | 60 const wchar_t* command_line, |
57 DWORD flags); | 61 DWORD flags); |
58 | 62 |
59 void InitializeWindowProcExceptions() { | 63 void InitializeWindowProcExceptions() { |
60 // Get the breakpad pointer from chrome.exe | 64 // Get the breakpad pointer from chrome.exe |
61 base::win::WinProcExceptionFilter exception_filter = | 65 base::win::WinProcExceptionFilter exception_filter = |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 MessageLoopForUI::current()->SetMessageFilter( | 208 MessageLoopForUI::current()->SetMessageFilter( |
205 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); | 209 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); |
206 } | 210 } |
207 } | 211 } |
208 } | 212 } |
209 | 213 |
210 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { | 214 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { |
211 ChromeBrowserMainParts::PreMainMessageLoopRun(); | 215 ChromeBrowserMainParts::PreMainMessageLoopRun(); |
212 | 216 |
213 removable_device_notifications_window_->Init(); | 217 removable_device_notifications_window_->Init(); |
| 218 #if defined(USE_AURA) |
| 219 metro_viewer_process_host_.reset(new MetroViewerProcessHost); |
| 220 #endif |
214 } | 221 } |
215 | 222 |
216 // static | 223 // static |
217 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 224 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
218 const CommandLine& parsed_command_line) { | 225 const CommandLine& parsed_command_line) { |
219 // Clear this var so child processes don't show the dialog by default. | 226 // Clear this var so child processes don't show the dialog by default. |
220 scoped_ptr<base::Environment> env(base::Environment::Create()); | 227 scoped_ptr<base::Environment> env(base::Environment::Create()); |
221 env->UnSetVar(env_vars::kShowRestart); | 228 env->UnSetVar(env_vars::kShowRestart); |
222 | 229 |
223 // For non-interactive tests we don't restart on crash. | 230 // For non-interactive tests we don't restart on crash. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if (resource_id) | 372 if (resource_id) |
366 return l10n_util::GetStringUTF16(resource_id); | 373 return l10n_util::GetStringUTF16(resource_id); |
367 return string16(); | 374 return string16(); |
368 } | 375 } |
369 | 376 |
370 // static | 377 // static |
371 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 378 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
372 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 379 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
373 installer::SetTranslationDelegate(&delegate); | 380 installer::SetTranslationDelegate(&delegate); |
374 } | 381 } |
OLD | NEW |