| 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 11 matching lines...) Expand all Loading... |
| 22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 23 #include "base/win/wrapped_window_proc.h" | 23 #include "base/win/wrapped_window_proc.h" |
| 24 #include "chrome/browser/browser_util_win.h" | 24 #include "chrome/browser/browser_util_win.h" |
| 25 #include "chrome/browser/first_run/first_run.h" | 25 #include "chrome/browser/first_run/first_run.h" |
| 26 #include "chrome/browser/metrics/metrics_service.h" | 26 #include "chrome/browser/metrics/metrics_service.h" |
| 27 #include "chrome/browser/profiles/profile_info_cache.h" | 27 #include "chrome/browser/profiles/profile_info_cache.h" |
| 28 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 28 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 29 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi
n.h" | 29 #include "chrome/browser/system_monitor/removable_device_notifications_window_wi
n.h" |
| 30 #include "chrome/browser/ui/simple_message_box.h" | 30 #include "chrome/browser/ui/simple_message_box.h" |
| 31 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 31 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
| 32 #include "chrome/browser/viewer/viewer_process_host.h" |
| 32 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
| 33 #include "chrome/common/chrome_result_codes.h" | 34 #include "chrome/common/chrome_result_codes.h" |
| 34 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/env_vars.h" | 36 #include "chrome/common/env_vars.h" |
| 36 #include "chrome/installer/util/browser_distribution.h" | 37 #include "chrome/installer/util/browser_distribution.h" |
| 37 #include "chrome/installer/util/helper.h" | 38 #include "chrome/installer/util/helper.h" |
| 38 #include "chrome/installer/util/install_util.h" | 39 #include "chrome/installer/util/install_util.h" |
| 39 #include "chrome/installer/util/l10n_string_util.h" | 40 #include "chrome/installer/util/l10n_string_util.h" |
| 40 #include "chrome/installer/util/shell_util.h" | 41 #include "chrome/installer/util/shell_util.h" |
| 41 #include "content/public/common/main_function_params.h" | 42 #include "content/public/common/main_function_params.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 scoped_ptr<base::win::TextServicesMessageFilter> tsf_message_filter( | 202 scoped_ptr<base::win::TextServicesMessageFilter> tsf_message_filter( |
| 202 new base::win::TextServicesMessageFilter); | 203 new base::win::TextServicesMessageFilter); |
| 203 if (tsf_message_filter->Init()) { | 204 if (tsf_message_filter->Init()) { |
| 204 MessageLoopForUI::current()->SetMessageFilter( | 205 MessageLoopForUI::current()->SetMessageFilter( |
| 205 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); | 206 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); |
| 206 } | 207 } |
| 207 } | 208 } |
| 208 } | 209 } |
| 209 | 210 |
| 210 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { | 211 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { |
| 212 DVLOG(1) << __FUNCTION__; |
| 211 ChromeBrowserMainParts::PreMainMessageLoopRun(); | 213 ChromeBrowserMainParts::PreMainMessageLoopRun(); |
| 212 | 214 |
| 213 removable_device_notifications_window_->Init(); | 215 removable_device_notifications_window_->Init(); |
| 216 viewer_process_host_.reset(new viewer::ViewerProcessHost); |
| 214 } | 217 } |
| 215 | 218 |
| 216 // static | 219 // static |
| 217 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 220 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
| 218 const CommandLine& parsed_command_line) { | 221 const CommandLine& parsed_command_line) { |
| 219 // Clear this var so child processes don't show the dialog by default. | 222 // Clear this var so child processes don't show the dialog by default. |
| 220 scoped_ptr<base::Environment> env(base::Environment::Create()); | 223 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 221 env->UnSetVar(env_vars::kShowRestart); | 224 env->UnSetVar(env_vars::kShowRestart); |
| 222 | 225 |
| 223 // For non-interactive tests we don't restart on crash. | 226 // 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) | 368 if (resource_id) |
| 366 return l10n_util::GetStringUTF16(resource_id); | 369 return l10n_util::GetStringUTF16(resource_id); |
| 367 return string16(); | 370 return string16(); |
| 368 } | 371 } |
| 369 | 372 |
| 370 // static | 373 // static |
| 371 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 374 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 372 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 375 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 373 installer::SetTranslationDelegate(&delegate); | 376 installer::SetTranslationDelegate(&delegate); |
| 374 } | 377 } |
| OLD | NEW |