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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
7 // | 7 // |
8 // OVERVIEW | 8 // OVERVIEW |
9 // | 9 // |
10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 #include "base/rand_util.h" | 156 #include "base/rand_util.h" |
157 #include "base/string_number_conversions.h" | 157 #include "base/string_number_conversions.h" |
158 #include "base/threading/platform_thread.h" | 158 #include "base/threading/platform_thread.h" |
159 #include "base/threading/thread.h" | 159 #include "base/threading/thread.h" |
160 #include "base/threading/thread_restrictions.h" | 160 #include "base/threading/thread_restrictions.h" |
161 #include "base/tracked_objects.h" | 161 #include "base/tracked_objects.h" |
162 #include "base/utf_string_conversions.h" | 162 #include "base/utf_string_conversions.h" |
163 #include "base/values.h" | 163 #include "base/values.h" |
164 #include "chrome/browser/autocomplete/autocomplete_log.h" | 164 #include "chrome/browser/autocomplete/autocomplete_log.h" |
165 #include "chrome/browser/bookmarks/bookmark_model.h" | 165 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 166 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
166 #include "chrome/browser/browser_process.h" | 167 #include "chrome/browser/browser_process.h" |
167 #include "chrome/browser/extensions/extension_service.h" | 168 #include "chrome/browser/extensions/extension_service.h" |
168 #include "chrome/browser/extensions/process_map.h" | 169 #include "chrome/browser/extensions/process_map.h" |
169 #include "chrome/browser/io_thread.h" | 170 #include "chrome/browser/io_thread.h" |
170 #include "chrome/browser/memory_details.h" | 171 #include "chrome/browser/memory_details.h" |
171 #include "chrome/browser/metrics/metrics_log.h" | 172 #include "chrome/browser/metrics/metrics_log.h" |
172 #include "chrome/browser/metrics/metrics_log_serializer.h" | 173 #include "chrome/browser/metrics/metrics_log_serializer.h" |
173 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" | 174 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" |
174 #include "chrome/browser/metrics/tracking_synchronizer.h" | 175 #include "chrome/browser/metrics/tracking_synchronizer.h" |
175 #include "chrome/browser/net/http_pipelining_compatibility_client.h" | 176 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 static_cast<MetricsLog*>(log_manager_.current_log()); | 707 static_cast<MetricsLog*>(log_manager_.current_log()); |
707 DCHECK(current_log); | 708 DCHECK(current_log); |
708 current_log->RecordOmniboxOpenedURL( | 709 current_log->RecordOmniboxOpenedURL( |
709 *content::Details<AutocompleteLog>(details).ptr()); | 710 *content::Details<AutocompleteLog>(details).ptr()); |
710 break; | 711 break; |
711 } | 712 } |
712 | 713 |
713 case chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED: { | 714 case chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED: { |
714 Profile* p = content::Source<Profile>(source).ptr(); | 715 Profile* p = content::Source<Profile>(source).ptr(); |
715 if (p) | 716 if (p) |
716 LogBookmarks(p->GetBookmarkModel()); | 717 LogBookmarks(BookmarkModelFactory::GetForProfile(p)); |
717 break; | 718 break; |
718 } | 719 } |
719 default: | 720 default: |
720 NOTREACHED(); | 721 NOTREACHED(); |
721 break; | 722 break; |
722 } | 723 } |
723 | 724 |
724 HandleIdleSinceLastTransmission(false); | 725 HandleIdleSinceLastTransmission(false); |
725 } | 726 } |
726 | 727 |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 if (local_state) { | 1905 if (local_state) { |
1905 const PrefService::Preference* uma_pref = | 1906 const PrefService::Preference* uma_pref = |
1906 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1907 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
1907 if (uma_pref) { | 1908 if (uma_pref) { |
1908 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1909 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
1909 DCHECK(success); | 1910 DCHECK(success); |
1910 } | 1911 } |
1911 } | 1912 } |
1912 return result; | 1913 return result; |
1913 } | 1914 } |
OLD | NEW |