Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/browser/managed_mode/managed_mode.cc

Issue 11783008: Add a lock to the managed user settings page and require authentication for unlocking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a randomly generated salt, small fix in key generation Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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",
96 PrefServiceSyncable::UNSYNCABLE_PREF);
97 prefs->RegisterStringPref(prefs::kManagedModeLocalSalt,
98 "managed_salt",
Bernhard Bauer 2013/01/07 14:39:22 Again, please use an empty string or something.
99 PrefServiceSyncable::UNSYNCABLE_PREF);
94 } 100 }
95 101
96 // static 102 // static
97 void ManagedMode::Init(Profile* profile) { 103 void ManagedMode::Init(Profile* profile) {
98 GetInstance()->InitImpl(profile); 104 GetInstance()->InitImpl(profile);
99 } 105 }
100 106
101 void ManagedMode::InitImpl(Profile* profile) { 107 void ManagedMode::InitImpl(Profile* profile) {
102 DCHECK(g_browser_process); 108 DCHECK(g_browser_process);
103 DCHECK(g_browser_process->local_state()); 109 DCHECK(g_browser_process->local_state());
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 ManagedModeURLFilter::FilteringBehavior behavior = 415 ManagedModeURLFilter::FilteringBehavior behavior =
410 ManagedModeURLFilter::BehaviorFromInt(behavior_value); 416 ManagedModeURLFilter::BehaviorFromInt(behavior_value);
411 io_url_filter_context_->SetDefaultFilteringBehavior(behavior); 417 io_url_filter_context_->SetDefaultFilteringBehavior(behavior);
412 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior); 418 ui_url_filter_context_->SetDefaultFilteringBehavior(behavior);
413 } 419 }
414 420
415 void ManagedMode::UpdateWhitelist() { 421 void ManagedMode::UpdateWhitelist() {
416 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); 422 io_url_filter_context_->LoadWhitelists(GetActiveSiteLists());
417 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists()); 423 ui_url_filter_context_->LoadWhitelists(GetActiveSiteLists());
418 } 424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698