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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 #if defined(OS_CHROMEOS) | 204 #if defined(OS_CHROMEOS) |
205 #include "chrome/browser/chromeos/cros/cros_library.h" | 205 #include "chrome/browser/chromeos/cros/cros_library.h" |
206 #include "chrome/browser/chromeos/external_metrics.h" | 206 #include "chrome/browser/chromeos/external_metrics.h" |
207 #include "chrome/browser/chromeos/system/statistics_provider.h" | 207 #include "chrome/browser/chromeos/system/statistics_provider.h" |
208 #endif | 208 #endif |
209 | 209 |
210 #if defined(OS_WIN) | 210 #if defined(OS_WIN) |
211 #include <windows.h> // Needed for STATUS_* codes | 211 #include <windows.h> // Needed for STATUS_* codes |
212 #endif | 212 #endif |
213 | 213 |
214 #if defined(OS_ANDROID) | |
215 #include "chrome/browser/ui/android/tab_model/tab_model_list_android.h" | |
216 #endif | |
217 | |
214 using base::Time; | 218 using base::Time; |
215 using content::BrowserThread; | 219 using content::BrowserThread; |
216 using content::ChildProcessData; | 220 using content::ChildProcessData; |
217 using content::LoadNotificationDetails; | 221 using content::LoadNotificationDetails; |
218 using content::PluginService; | 222 using content::PluginService; |
219 | 223 |
220 namespace { | 224 namespace { |
221 | 225 |
222 // Check to see that we're being called on only one thread. | 226 // Check to see that we're being called on only one thread. |
223 bool IsSingleThreaded() { | 227 bool IsSingleThreaded() { |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1846 child_process_stats_buffer_.clear(); | 1850 child_process_stats_buffer_.clear(); |
1847 } | 1851 } |
1848 | 1852 |
1849 bool MetricsService::CanLogNotification( | 1853 bool MetricsService::CanLogNotification( |
1850 int type, | 1854 int type, |
1851 const content::NotificationSource& source, | 1855 const content::NotificationSource& source, |
1852 const content::NotificationDetails& details) { | 1856 const content::NotificationDetails& details) { |
1853 // We simply don't log anything to UMA if there is a single incognito | 1857 // We simply don't log anything to UMA if there is a single incognito |
1854 // session visible. The problem is that we always notify using the orginal | 1858 // session visible. The problem is that we always notify using the orginal |
1855 // profile in order to simplify notification processing. | 1859 // profile in order to simplify notification processing. |
1860 #if defined(OS_ANDROID) | |
1861 return !TabModelListAndroid::IsOffTheRecordSessionActive(); | |
sky
2012/07/16 23:07:30
I would rather see a function in the browser names
David Trainor- moved to gerrit
2012/07/18 23:59:04
Done.
jar (doing other things)
2012/07/19 00:11:35
I see the comment... and your "done," but don't se
| |
1862 #else | |
1856 return !BrowserList::IsOffTheRecordSessionActive(); | 1863 return !BrowserList::IsOffTheRecordSessionActive(); |
1864 #endif | |
1857 } | 1865 } |
1858 | 1866 |
1859 void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { | 1867 void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { |
1860 DCHECK(IsSingleThreaded()); | 1868 DCHECK(IsSingleThreaded()); |
1861 | 1869 |
1862 PrefService* pref = g_browser_process->local_state(); | 1870 PrefService* pref = g_browser_process->local_state(); |
1863 DCHECK(pref); | 1871 DCHECK(pref); |
1864 | 1872 |
1865 pref->SetBoolean(path, value); | 1873 pref->SetBoolean(path, value); |
1866 RecordCurrentState(pref); | 1874 RecordCurrentState(pref); |
(...skipping 26 matching lines...) Expand all Loading... | |
1893 if (local_state) { | 1901 if (local_state) { |
1894 const PrefService::Preference* uma_pref = | 1902 const PrefService::Preference* uma_pref = |
1895 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1903 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
1896 if (uma_pref) { | 1904 if (uma_pref) { |
1897 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1905 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
1898 DCHECK(success); | 1906 DCHECK(success); |
1899 } | 1907 } |
1900 } | 1908 } |
1901 return result; | 1909 return result; |
1902 } | 1910 } |
OLD | NEW |