| 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" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(URLFilterContext); | 76 DISALLOW_COPY_AND_ASSIGN(URLFilterContext); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 // static | 79 // static |
| 80 ManagedMode* ManagedMode::GetInstance() { | 80 ManagedMode* ManagedMode::GetInstance() { |
| 81 return Singleton<ManagedMode, LeakySingletonTraits<ManagedMode> >::get(); | 81 return Singleton<ManagedMode, LeakySingletonTraits<ManagedMode> >::get(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 // static | 84 // static |
| 85 void ManagedMode::RegisterPrefs(PrefService* prefs) { | 85 void ManagedMode::RegisterPrefs(PrefServiceSimple* prefs) { |
| 86 prefs->RegisterBooleanPref(prefs::kInManagedMode, false); | 86 prefs->RegisterBooleanPref(prefs::kInManagedMode, false); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // static | 89 // static |
| 90 void ManagedMode::RegisterUserPrefs(PrefService* prefs) { | 90 void ManagedMode::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 91 prefs->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, | 91 prefs->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, |
| 92 2, | 92 2, |
| 93 PrefService::UNSYNCABLE_PREF); | 93 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 94 } | 94 } |
| 95 | 95 |
| 96 // static | 96 // static |
| 97 void ManagedMode::Init(Profile* profile) { | 97 void ManagedMode::Init(Profile* profile) { |
| 98 GetInstance()->InitImpl(profile); | 98 GetInstance()->InitImpl(profile); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void ManagedMode::InitImpl(Profile* profile) { | 101 void ManagedMode::InitImpl(Profile* profile) { |
| 102 DCHECK(g_browser_process); | 102 DCHECK(g_browser_process); |
| 103 DCHECK(g_browser_process->local_state()); | 103 DCHECK(g_browser_process->local_state()); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 ManagedModeURLFilter::FilteringBehavior behavior = | 409 ManagedModeURLFilter::FilteringBehavior behavior = |
| 410 ManagedModeURLFilter::BehaviorFromInt(behavior_value); | 410 ManagedModeURLFilter::BehaviorFromInt(behavior_value); |
| 411 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); | 411 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); |
| 412 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); | 412 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); |
| 413 } | 413 } |
| 414 | 414 |
| 415 void ManagedMode::UpdateWhitelist() { | 415 void ManagedMode::UpdateWhitelist() { |
| 416 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); | 416 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); |
| 417 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); | 417 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); |
| 418 } | 418 } |
| OLD | NEW |