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/managed_mode/managed_mode.h" | 5 #include "chrome/browser/managed_mode/managed_mode.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/public/pref_change_registrar.h" | 8 #include "base/prefs/public/pref_change_registrar.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
13 #include "chrome/browser/managed_mode/managed_mode_site_list.h" | 13 #include "chrome/browser/managed_mode/managed_mode_site_list.h" |
14 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" | 14 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" |
| 15 #include "chrome/browser/prefs/pref_registrar_simple.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
19 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
20 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
21 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
22 #include "chrome/common/extensions/extension_set.h" | 23 #include "chrome/common/extensions/extension_set.h" |
23 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(URLFilterContext); | 77 DISALLOW_COPY_AND_ASSIGN(URLFilterContext); |
77 }; | 78 }; |
78 | 79 |
79 // static | 80 // static |
80 ManagedMode* ManagedMode::GetInstance() { | 81 ManagedMode* ManagedMode::GetInstance() { |
81 return Singleton<ManagedMode, LeakySingletonTraits<ManagedMode> >::get(); | 82 return Singleton<ManagedMode, LeakySingletonTraits<ManagedMode> >::get(); |
82 } | 83 } |
83 | 84 |
84 // static | 85 // static |
85 void ManagedMode::RegisterPrefs(PrefServiceSimple* prefs) { | 86 void ManagedMode::RegisterPrefs(PrefRegistrarSimple* prefs) { |
86 prefs->RegisterBooleanPref(prefs::kInManagedMode, false); | 87 prefs->RegisterBooleanPref(prefs::kInManagedMode, false); |
87 } | 88 } |
88 | 89 |
89 // static | 90 // static |
90 void ManagedMode::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 91 void ManagedMode::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
91 prefs->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, | 92 prefs->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, |
92 2, | 93 2, |
93 PrefServiceSyncable::UNSYNCABLE_PREF); | 94 PrefServiceSyncable::UNSYNCABLE_PREF); |
94 } | 95 } |
95 | 96 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 ManagedModeURLFilter::FilteringBehavior behavior = | 410 ManagedModeURLFilter::FilteringBehavior behavior = |
410 ManagedModeURLFilter::BehaviorFromInt(behavior_value); | 411 ManagedModeURLFilter::BehaviorFromInt(behavior_value); |
411 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); | 412 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); |
412 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); | 413 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); |
413 } | 414 } |
414 | 415 |
415 void ManagedMode::UpdateWhitelist() { | 416 void ManagedMode::UpdateWhitelist() { |
416 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); | 417 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); |
417 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); | 418 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); |
418 } | 419 } |
OLD | NEW |