Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 // static | 84 // static |
| 85 void ManagedMode::RegisterPrefs(PrefServiceSimple* 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(PrefServiceSyncable* prefs) { | 90 void ManagedMode::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
| 91 prefs->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, | 91 prefs->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, |
| 92 2, | 92 2, |
| 93 PrefServiceSyncable::UNSYNCABLE_PREF); | 93 PrefServiceSyncable::UNSYNCABLE_PREF); |
| 94 prefs->RegisterStringPref(prefs::kManagedModeLocalPassphrase, | |
| 95 "default", | |
|
Bernhard Bauer
2013/01/07 14:20:22
I think an empty string would be better as a defau
Pam (message me for reviews)
2013/01/07 14:51:49
I think we should make this empty as a default, an
| |
| 96 PrefServiceSyncable::UNSYNCABLE_PREF); | |
| 94 } | 97 } |
| 95 | 98 |
| 96 // static | 99 // static |
| 97 void ManagedMode::Init(Profile* profile) { | 100 void ManagedMode::Init(Profile* profile) { |
| 98 GetInstance()->InitImpl(profile); | 101 GetInstance()->InitImpl(profile); |
| 99 } | 102 } |
| 100 | 103 |
| 101 void ManagedMode::InitImpl(Profile* profile) { | 104 void ManagedMode::InitImpl(Profile* profile) { |
| 102 DCHECK(g_browser_process); | 105 DCHECK(g_browser_process); |
| 103 DCHECK(g_browser_process->local_state()); | 106 DCHECK(g_browser_process->local_state()); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 ManagedModeURLFilter::FilteringBehavior behavior = | 412 ManagedModeURLFilter::FilteringBehavior behavior = |
| 410 ManagedModeURLFilter::BehaviorFromInt(behavior_value); | 413 ManagedModeURLFilter::BehaviorFromInt(behavior_value); |
| 411 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); | 414 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); |
| 412 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); | 415 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); |
| 413 } | 416 } |
| 414 | 417 |
| 415 void ManagedMode::UpdateWhitelist() { | 418 void ManagedMode::UpdateWhitelist() { |
| 416 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); | 419 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); |
| 417 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); | 420 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); |
| 418 } | 421 } |
| OLD | NEW |