Chromium Code Reviews| 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 <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 #include "chrome/browser/ui/simple_message_box.h" | 36 #include "chrome/browser/ui/simple_message_box.h" |
| 37 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 37 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
| 38 #include "chrome/browser/win/browser_util.h" | 38 #include "chrome/browser/win/browser_util.h" |
| 39 #include "chrome/browser/win/chrome_elf_init.h" | 39 #include "chrome/browser/win/chrome_elf_init.h" |
| 40 #include "chrome/chrome_watcher/chrome_watcher_main_api.h" | 40 #include "chrome/chrome_watcher/chrome_watcher_main_api.h" |
| 41 #include "chrome/common/chrome_constants.h" | 41 #include "chrome/common/chrome_constants.h" |
| 42 #include "chrome/common/chrome_paths.h" | 42 #include "chrome/common/chrome_paths.h" |
| 43 #include "chrome/common/chrome_result_codes.h" | 43 #include "chrome/common/chrome_result_codes.h" |
| 44 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
| 45 #include "chrome/common/chrome_utility_messages.h" | 45 #include "chrome/common/chrome_utility_messages.h" |
| 46 #include "chrome/common/crash_keys.h" | |
| 46 #include "chrome/common/env_vars.h" | 47 #include "chrome/common/env_vars.h" |
| 47 #include "chrome/grit/chromium_strings.h" | 48 #include "chrome/grit/chromium_strings.h" |
| 48 #include "chrome/grit/generated_resources.h" | 49 #include "chrome/grit/generated_resources.h" |
| 49 #include "chrome/installer/util/browser_distribution.h" | 50 #include "chrome/installer/util/browser_distribution.h" |
| 50 #include "chrome/installer/util/helper.h" | 51 #include "chrome/installer/util/helper.h" |
| 51 #include "chrome/installer/util/install_util.h" | 52 #include "chrome/installer/util/install_util.h" |
| 52 #include "chrome/installer/util/installer_util_strings.h" | 53 #include "chrome/installer/util/installer_util_strings.h" |
| 53 #include "chrome/installer/util/l10n_string_util.h" | 54 #include "chrome/installer/util/l10n_string_util.h" |
| 54 #include "chrome/installer/util/shell_util.h" | 55 #include "chrome/installer/util/shell_util.h" |
| 55 #include "content/public/browser/browser_thread.h" | 56 #include "content/public/browser/browser_thread.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 SetupInstallerUtilStrings(); | 283 SetupInstallerUtilStrings(); |
| 283 | 284 |
| 284 ChromeBrowserMainParts::PreMainMessageLoopStart(); | 285 ChromeBrowserMainParts::PreMainMessageLoopStart(); |
| 285 if (!parameters().ui_task) { | 286 if (!parameters().ui_task) { |
| 286 // Make sure that we know how to handle exceptions from the message loop. | 287 // Make sure that we know how to handle exceptions from the message loop. |
| 287 InitializeWindowProcExceptions(); | 288 InitializeWindowProcExceptions(); |
| 288 } | 289 } |
| 289 } | 290 } |
| 290 | 291 |
| 291 int ChromeBrowserMainPartsWin::PreCreateThreads() { | 292 int ChromeBrowserMainPartsWin::PreCreateThreads() { |
| 293 // Record whether the machine is domain joined in a crash key. This will be used | |
| 294 // to better identify whether crashes are from enterprise users. | |
| 295 #if defined(OS_WIN) | |
|
sky
2016/12/06 23:23:43
These ifdefs should no longer be necessary (this f
Georges Khalil
2016/12/07 15:00:22
Oops, removed.
| |
| 296 base::debug::SetCrashKeyValue(crash_keys::kEnrolledToDomain, | |
| 297 base::win::IsEnrolledToDomain() ? "yes" : "no"); | |
| 298 #endif | |
| 299 | |
| 292 int rv = ChromeBrowserMainParts::PreCreateThreads(); | 300 int rv = ChromeBrowserMainParts::PreCreateThreads(); |
| 293 | 301 |
| 294 // TODO(viettrungluu): why don't we run this earlier? | 302 // TODO(viettrungluu): why don't we run this earlier? |
| 295 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && | 303 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && |
| 296 base::win::GetVersion() < base::win::VERSION_XP) { | 304 base::win::GetVersion() < base::win::VERSION_XP) { |
| 297 chrome::ShowWarningMessageBox( | 305 chrome::ShowWarningMessageBox( |
| 298 NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 306 NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 299 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP)); | 307 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP)); |
| 300 } | 308 } |
| 301 | 309 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 if (resource_id) | 527 if (resource_id) |
| 520 return l10n_util::GetStringUTF16(resource_id); | 528 return l10n_util::GetStringUTF16(resource_id); |
| 521 return base::string16(); | 529 return base::string16(); |
| 522 } | 530 } |
| 523 | 531 |
| 524 // static | 532 // static |
| 525 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 533 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 526 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 534 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 527 installer::SetTranslationDelegate(&delegate); | 535 installer::SetTranslationDelegate(&delegate); |
| 528 } | 536 } |
| OLD | NEW |