| 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/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "extensions/common/constants.h" | 53 #include "extensions/common/constants.h" |
| 54 #include "ui/base/material_design/material_design_controller.h" | 54 #include "ui/base/material_design/material_design_controller.h" |
| 55 #include "ui/base/resource/resource_bundle.h" | 55 #include "ui/base/resource/resource_bundle.h" |
| 56 #include "ui/base/ui_base_switches.h" | 56 #include "ui/base/ui_base_switches.h" |
| 57 | 57 |
| 58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
| 59 #include <atlbase.h> | 59 #include <atlbase.h> |
| 60 #include <malloc.h> | 60 #include <malloc.h> |
| 61 #include <algorithm> | 61 #include <algorithm> |
| 62 #include "base/debug/close_handle_hook_win.h" | 62 #include "base/debug/close_handle_hook_win.h" |
| 63 #include "chrome/browser/downgrade/user_data_downgrade.h" |
| 63 #include "chrome/common/child_process_logging.h" | 64 #include "chrome/common/child_process_logging.h" |
| 64 #include "chrome/common/v8_breakpad_support_win.h" | 65 #include "chrome/common/v8_breakpad_support_win.h" |
| 65 #include "components/crash/content/app/crashpad.h" | 66 #include "components/crash/content/app/crashpad.h" |
| 66 #include "sandbox/win/src/sandbox.h" | 67 #include "sandbox/win/src/sandbox.h" |
| 67 #include "ui/base/resource/resource_bundle_win.h" | 68 #include "ui/base/resource/resource_bundle_win.h" |
| 68 #endif | 69 #endif |
| 69 | 70 |
| 70 #if defined(OS_MACOSX) | 71 #if defined(OS_MACOSX) |
| 71 #include "base/mac/foundation_util.h" | 72 #include "base/mac/foundation_util.h" |
| 72 #include "chrome/app/chrome_main_mac.h" | 73 #include "chrome/app/chrome_main_mac.h" |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 #if defined(OS_WIN) | 726 #if defined(OS_WIN) |
| 726 child_process_logging::Init(); | 727 child_process_logging::Init(); |
| 727 #endif | 728 #endif |
| 728 #if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX)) | 729 #if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX)) |
| 729 // Create an instance of the CPU class to parse /proc/cpuinfo and cache | 730 // Create an instance of the CPU class to parse /proc/cpuinfo and cache |
| 730 // cpu_brand info. | 731 // cpu_brand info. |
| 731 base::CPU cpu_info; | 732 base::CPU cpu_info; |
| 732 #endif | 733 #endif |
| 733 | 734 |
| 734 // Initialize the user data dir for any process type that needs it. | 735 // Initialize the user data dir for any process type that needs it. |
| 735 if (chrome::ProcessNeedsProfileDir(process_type)) | 736 if (chrome::ProcessNeedsProfileDir(process_type)) { |
| 736 InitializeUserDataDir(); | 737 InitializeUserDataDir(); |
| 738 #if defined(OS_WIN) && !defined(CHROME_MULTIPLE_DLL_CHILD) |
| 739 if (downgrade::IsMSIInstall()) { |
| 740 downgrade::MoveUserDataForFirstRunAfterDowngrade(); |
| 741 base::FilePath user_data_dir; |
| 742 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) |
| 743 downgrade::UpdateLastVersion(user_data_dir); |
| 744 } |
| 745 #endif |
| 746 } |
| 737 | 747 |
| 738 // Register component_updater PathProvider after DIR_USER_DATA overidden by | 748 // Register component_updater PathProvider after DIR_USER_DATA overidden by |
| 739 // command line flags. Maybe move the chrome PathProvider down here also? | 749 // command line flags. Maybe move the chrome PathProvider down here also? |
| 740 component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS, | 750 component_updater::RegisterPathProvider(chrome::DIR_COMPONENTS, |
| 741 chrome::DIR_USER_DATA); | 751 chrome::DIR_USER_DATA); |
| 742 | 752 |
| 743 // Enable Message Loop related state asap. | 753 // Enable Message Loop related state asap. |
| 744 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) | 754 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) |
| 745 base::MessageLoop::EnableHistogrammer(true); | 755 base::MessageLoop::EnableHistogrammer(true); |
| 746 | 756 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 case version_info::Channel::CANARY: | 1043 case version_info::Channel::CANARY: |
| 1034 return true; | 1044 return true; |
| 1035 case version_info::Channel::DEV: | 1045 case version_info::Channel::DEV: |
| 1036 case version_info::Channel::BETA: | 1046 case version_info::Channel::BETA: |
| 1037 case version_info::Channel::STABLE: | 1047 case version_info::Channel::STABLE: |
| 1038 default: | 1048 default: |
| 1039 // Don't enable instrumentation. | 1049 // Don't enable instrumentation. |
| 1040 return false; | 1050 return false; |
| 1041 } | 1051 } |
| 1042 } | 1052 } |
| OLD | NEW |