| 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.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 #include "chromeos/settings/cros_settings_names.h" | 193 #include "chromeos/settings/cros_settings_names.h" |
| 194 #endif // defined(OS_CHROMEOS) | 194 #endif // defined(OS_CHROMEOS) |
| 195 | 195 |
| 196 // TODO(port): several win-only methods have been pulled out of this, but | 196 // TODO(port): several win-only methods have been pulled out of this, but |
| 197 // BrowserMain() as a whole needs to be broken apart so that it's usable by | 197 // BrowserMain() as a whole needs to be broken apart so that it's usable by |
| 198 // other platforms. For now, it's just a stub. This is a serious work in | 198 // other platforms. For now, it's just a stub. This is a serious work in |
| 199 // progress and should not be taken as an indication of a real refactoring. | 199 // progress and should not be taken as an indication of a real refactoring. |
| 200 | 200 |
| 201 #if defined(OS_WIN) | 201 #if defined(OS_WIN) |
| 202 #include "base/trace_event/trace_event_etw_export_win.h" | 202 #include "base/trace_event/trace_event_etw_export_win.h" |
| 203 #include "base/win/registry.h" | |
| 204 #include "base/win/win_util.h" | 203 #include "base/win/win_util.h" |
| 205 #include "chrome/browser/chrome_browser_main_win.h" | 204 #include "chrome/browser/chrome_browser_main_win.h" |
| 206 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" | 205 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" |
| 207 #include "chrome/browser/downgrade/user_data_downgrade.h" | 206 #include "chrome/browser/downgrade/user_data_downgrade.h" |
| 208 #include "chrome/browser/first_run/upgrade_util_win.h" | 207 #include "chrome/browser/first_run/upgrade_util_win.h" |
| 209 #include "chrome/browser/ui/network_profile_bubble.h" | 208 #include "chrome/browser/ui/network_profile_bubble.h" |
| 210 #include "chrome/browser/ui/views/try_chrome_dialog_view.h" | 209 #include "chrome/browser/ui/views/try_chrome_dialog_view.h" |
| 211 #include "chrome/browser/win/browser_util.h" | 210 #include "chrome/browser/win/browser_util.h" |
| 212 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" | 211 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" |
| 213 #include "chrome/install_static/install_util.h" | 212 #include "chrome/install_static/install_util.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 757 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
| 759 // Even though base::Bind does AddRef and Release, the object will not be | 758 // Even though base::Bind does AddRef and Release, the object will not be |
| 760 // deleted after the Task is executed. | 759 // deleted after the Task is executed. |
| 761 field_trial_synchronizer_ = new FieldTrialSynchronizer(); | 760 field_trial_synchronizer_ = new FieldTrialSynchronizer(); |
| 762 | 761 |
| 763 #if defined(OS_WIN) || defined(OS_MACOSX) || \ | 762 #if defined(OS_WIN) || defined(OS_MACOSX) || \ |
| 764 (defined(OS_LINUX) && !defined(OS_CHROMEOS)) | 763 (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| 765 metrics::DesktopSessionDurationTracker::Initialize(); | 764 metrics::DesktopSessionDurationTracker::Initialize(); |
| 766 #endif | 765 #endif |
| 767 metrics::RendererUptimeTracker::Initialize(); | 766 metrics::RendererUptimeTracker::Initialize(); |
| 768 | |
| 769 #if defined(OS_WIN) | |
| 770 // Cleanup the PreRead field trial registry key. | |
| 771 // TODO(fdoray): Remove this when M56 hits stable. | |
| 772 const base::string16 pre_read_field_trial_registry_path = | |
| 773 install_static::GetRegistryPath() + L"\\PreReadFieldTrial"; | |
| 774 base::win::RegKey(HKEY_CURRENT_USER, | |
| 775 pre_read_field_trial_registry_path.c_str(), KEY_SET_VALUE) | |
| 776 .DeleteKey(L""); | |
| 777 #endif // defined(OS_WIN) | |
| 778 } | 767 } |
| 779 | 768 |
| 780 void ChromeBrowserMainParts::SetupMetrics() { | 769 void ChromeBrowserMainParts::SetupMetrics() { |
| 781 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetrics"); | 770 TRACE_EVENT0("startup", "ChromeBrowserMainParts::SetupMetrics"); |
| 782 metrics::MetricsService* metrics = browser_process_->metrics_service(); | 771 metrics::MetricsService* metrics = browser_process_->metrics_service(); |
| 783 metrics->AddSyntheticTrialObserver( | 772 metrics->AddSyntheticTrialObserver( |
| 784 variations::VariationsHttpHeaderProvider::GetInstance()); | 773 variations::VariationsHttpHeaderProvider::GetInstance()); |
| 785 // Now that field trials have been created, initializes metrics recording. | 774 // Now that field trials have been created, initializes metrics recording. |
| 786 metrics->InitializeMetricsRecordingState(); | 775 metrics->InitializeMetricsRecordingState(); |
| 787 | 776 |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2076 chromeos::CrosSettings::Shutdown(); | 2065 chromeos::CrosSettings::Shutdown(); |
| 2077 #endif // defined(OS_CHROMEOS) | 2066 #endif // defined(OS_CHROMEOS) |
| 2078 #endif // defined(OS_ANDROID) | 2067 #endif // defined(OS_ANDROID) |
| 2079 } | 2068 } |
| 2080 | 2069 |
| 2081 // Public members: | 2070 // Public members: |
| 2082 | 2071 |
| 2083 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2072 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2084 chrome_extra_parts_.push_back(parts); | 2073 chrome_extra_parts_.push_back(parts); |
| 2085 } | 2074 } |
| OLD | NEW |