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.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 #include "chrome/common/chrome_switches.h" | 98 #include "chrome/common/chrome_switches.h" |
| 99 #include "chrome/common/crash_keys.h" | 99 #include "chrome/common/crash_keys.h" |
| 100 #include "chrome/common/env_vars.h" | 100 #include "chrome/common/env_vars.h" |
| 101 #include "chrome/common/logging_chrome.h" | 101 #include "chrome/common/logging_chrome.h" |
| 102 #include "chrome/common/net/net_resource_provider.h" | 102 #include "chrome/common/net/net_resource_provider.h" |
| 103 #include "chrome/common/pref_names.h" | 103 #include "chrome/common/pref_names.h" |
| 104 #include "chrome/common/profiling.h" | 104 #include "chrome/common/profiling.h" |
| 105 #include "chrome/installer/util/google_update_settings.h" | 105 #include "chrome/installer/util/google_update_settings.h" |
| 106 #include "components/google/core/browser/google_util.h" | 106 #include "components/google/core/browser/google_util.h" |
| 107 #include "components/language_usage_metrics/language_usage_metrics.h" | 107 #include "components/language_usage_metrics/language_usage_metrics.h" |
| 108 #include "components/metrics/metrics_pref_names.h" | |
| 108 #include "components/metrics/metrics_service.h" | 109 #include "components/metrics/metrics_service.h" |
| 109 #include "components/nacl/browser/nacl_browser.h" | 110 #include "components/nacl/browser/nacl_browser.h" |
| 110 #include "components/nacl/browser/nacl_process_host.h" | 111 #include "components/nacl/browser/nacl_process_host.h" |
| 111 #include "components/rappor/rappor_service.h" | 112 #include "components/rappor/rappor_service.h" |
| 112 #include "components/signin/core/common/profile_management_switches.h" | 113 #include "components/signin/core/common/profile_management_switches.h" |
| 113 #include "components/startup_metric_utils/startup_metric_utils.h" | 114 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 114 #include "components/translate/core/browser/translate_download_manager.h" | 115 #include "components/translate/core/browser/translate_download_manager.h" |
| 115 #include "content/public/browser/browser_thread.h" | 116 #include "content/public/browser/browser_thread.h" |
| 116 #include "content/public/browser/notification_observer.h" | 117 #include "content/public/browser/notification_observer.h" |
| 117 #include "content/public/browser/notification_registrar.h" | 118 #include "content/public/browser/notification_registrar.h" |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 base::debug::SetCrashKeyValue(crash_keys::kChannel, | 933 base::debug::SetCrashKeyValue(crash_keys::kChannel, |
| 933 chrome::VersionInfo::GetVersionStringModifier()); | 934 chrome::VersionInfo::GetVersionStringModifier()); |
| 934 #endif | 935 #endif |
| 935 | 936 |
| 936 // Initialize tracking synchronizer system. | 937 // Initialize tracking synchronizer system. |
| 937 tracking_synchronizer_ = new chrome_browser_metrics::TrackingSynchronizer(); | 938 tracking_synchronizer_ = new chrome_browser_metrics::TrackingSynchronizer(); |
| 938 | 939 |
| 939 // Now that all preferences have been registered, set the install date | 940 // Now that all preferences have been registered, set the install date |
| 940 // for the uninstall metrics if this is our first run. This only actually | 941 // for the uninstall metrics if this is our first run. This only actually |
| 941 // gets used if the user has metrics reporting enabled at uninstall time. | 942 // gets used if the user has metrics reporting enabled at uninstall time. |
| 942 int64 install_date = local_state_->GetInt64(prefs::kInstallDate); | 943 int64 install_date = local_state_->GetInt64(metrics::prefs::kInstallDate); |
| 943 if (install_date == 0) | 944 if (install_date == 0) { |
| 944 local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); | 945 local_state_->SetInt64(metrics::prefs::kInstallDate, |
| 946 base::Time::Now().ToTimeT()); | |
|
Alexei Svitkine (slow)
2014/07/14 17:00:53
I don't like the fact that we're recording install
gab
2014/07/14 19:38:13
SGTM, in fact how about we just do this automatica
Alexei Svitkine (slow)
2014/07/14 19:40:38
That sounds even better assuming it's safe to do (
gab
2014/07/14 19:52:37
Well that's the same (slightly earlier in fact) as
Alexei Svitkine (slow)
2014/07/15 15:49:33
I was originally suggesting it to be a static meth
gab
2014/07/15 22:13:15
Follow-up CL posted @ https://codereview.chromium.
| |
| 947 } | |
| 945 | 948 |
| 946 #if defined(OS_MACOSX) | 949 #if defined(OS_MACOSX) |
| 947 // Get the Keychain API to register for distributed notifications on the main | 950 // Get the Keychain API to register for distributed notifications on the main |
| 948 // thread, which has a proper CFRunloop, instead of later on the I/O thread, | 951 // thread, which has a proper CFRunloop, instead of later on the I/O thread, |
| 949 // which doesn't. This ensures those notifications will get delivered | 952 // which doesn't. This ensures those notifications will get delivered |
| 950 // properly. See issue 37766. | 953 // properly. See issue 37766. |
| 951 // (Note that the callback mask here is empty. I don't want to register for | 954 // (Note that the callback mask here is empty. I don't want to register for |
| 952 // any callbacks, I just want to initialize the mechanism.) | 955 // any callbacks, I just want to initialize the mechanism.) |
| 953 SecKeychainAddCallback(&KeychainCallback, 0, NULL); | 956 SecKeychainAddCallback(&KeychainCallback, 0, NULL); |
| 954 #endif | 957 #endif |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1656 chromeos::CrosSettings::Shutdown(); | 1659 chromeos::CrosSettings::Shutdown(); |
| 1657 #endif | 1660 #endif |
| 1658 #endif | 1661 #endif |
| 1659 } | 1662 } |
| 1660 | 1663 |
| 1661 // Public members: | 1664 // Public members: |
| 1662 | 1665 |
| 1663 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1666 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 1664 chrome_extra_parts_.push_back(parts); | 1667 chrome_extra_parts_.push_back(parts); |
| 1665 } | 1668 } |
| OLD | NEW |