OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/content_settings/content_settings_pref_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/metrics/histogram.h" | |
12 #include "chrome/browser/content_settings/content_settings_details.h" | 13 #include "chrome/browser/content_settings/content_settings_details.h" |
13 #include "chrome/browser/content_settings/content_settings_pattern.h" | 14 #include "chrome/browser/content_settings/content_settings_pattern.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 16 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
18 #include "chrome/common/content_settings.h" | 19 #include "chrome/common/content_settings.h" |
19 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
20 #include "content/browser/browser_thread.h" | 21 #include "content/browser/browser_thread.h" |
21 #include "content/browser/user_metrics.h" | 22 #include "content/browser/user_metrics.h" |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 } | 366 } |
366 if (prefs->GetInteger(prefs::kContentSettingsVersion) > | 367 if (prefs->GetInteger(prefs::kContentSettingsVersion) > |
367 ContentSettingsPattern::kContentSettingsPatternVersion) { | 368 ContentSettingsPattern::kContentSettingsPatternVersion) { |
368 LOG(ERROR) << "Unknown content settings version in preferences."; | 369 LOG(ERROR) << "Unknown content settings version in preferences."; |
369 return; | 370 return; |
370 } | 371 } |
371 | 372 |
372 // Read exceptions. | 373 // Read exceptions. |
373 ReadExceptions(false); | 374 ReadExceptions(false); |
374 | 375 |
376 if (!is_incognito()) { | |
377 UMA_HISTOGRAM_COUNTS("ContentSettings.NumberOfExceptions", | |
jar (doing other things)
2011/05/25 02:19:50
One thing to test is to be sure the histogram syst
| |
378 host_content_settings()->size()); | |
379 } | |
380 | |
375 pref_change_registrar_.Init(prefs); | 381 pref_change_registrar_.Init(prefs); |
376 pref_change_registrar_.Add(prefs::kContentSettingsPatterns, this); | 382 pref_change_registrar_.Add(prefs::kContentSettingsPatterns, this); |
377 | 383 |
378 notification_registrar_.Add(this, NotificationType::PROFILE_DESTROYED, | 384 notification_registrar_.Add(this, NotificationType::PROFILE_DESTROYED, |
379 Source<Profile>(profile_)); | 385 Source<Profile>(profile_)); |
380 initializing_ = false; | 386 initializing_ = false; |
381 } | 387 } |
382 | 388 |
383 void PrefProvider::SetContentSetting( | 389 void PrefProvider::SetContentSetting( |
384 const ContentSettingsPattern& requesting_pattern, | 390 const ContentSettingsPattern& requesting_pattern, |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
827 ContentSettingsPattern::FromString(host), | 833 ContentSettingsPattern::FromString(host), |
828 CONTENT_SETTINGS_TYPE_POPUPS, | 834 CONTENT_SETTINGS_TYPE_POPUPS, |
829 "", | 835 "", |
830 CONTENT_SETTING_ALLOW); | 836 CONTENT_SETTING_ALLOW); |
831 } | 837 } |
832 prefs->ClearPref(prefs::kPopupWhitelistedHosts); | 838 prefs->ClearPref(prefs::kPopupWhitelistedHosts); |
833 } | 839 } |
834 } | 840 } |
835 | 841 |
836 } // namespace content_settings | 842 } // namespace content_settings |
OLD | NEW |