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

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

Issue 13778004: Start in elevated mode when creating a new managed user profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nit. Created 7 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_user_service.h" 5 #include "chrome/browser/managed_mode/managed_user_service.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void ManagedUserService::URLFilterContext::SetManualURLs( 97 void ManagedUserService::URLFilterContext::SetManualURLs(
98 scoped_ptr<std::map<GURL, bool> > url_map) { 98 scoped_ptr<std::map<GURL, bool> > url_map) {
99 ui_url_filter_->SetManualURLs(url_map.get()); 99 ui_url_filter_->SetManualURLs(url_map.get());
100 BrowserThread::PostTask( 100 BrowserThread::PostTask(
101 BrowserThread::IO, 101 BrowserThread::IO,
102 FROM_HERE, 102 FROM_HERE,
103 base::Bind(&ManagedModeURLFilter::SetManualURLs, 103 base::Bind(&ManagedModeURLFilter::SetManualURLs,
104 io_url_filter_, base::Owned(url_map.release()))); 104 io_url_filter_, base::Owned(url_map.release())));
105 } 105 }
106 106
107 ManagedUserService::ManagedUserService(Profile* profile) : profile_(profile) { 107 ManagedUserService::ManagedUserService(Profile* profile)
108 : profile_(profile), startup_elevation_(false) {
108 } 109 }
109 110
110 ManagedUserService::~ManagedUserService() { 111 ManagedUserService::~ManagedUserService() {
111 } 112 }
112 113
113 bool ManagedUserService::ProfileIsManaged() const { 114 bool ManagedUserService::ProfileIsManaged() const {
114 return profile_->GetPrefs()->GetBoolean(prefs::kProfileIsManaged); 115 return profile_->GetPrefs()->GetBoolean(prefs::kProfileIsManaged);
115 } 116 }
116 117
117 bool ManagedUserService::IsElevatedForWebContents( 118 bool ManagedUserService::IsElevatedForWebContents(
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); 479 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs);
479 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); 480 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>());
480 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { 481 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
481 bool allow = false; 482 bool allow = false;
482 bool result = it.value().GetAsBoolean(&allow); 483 bool result = it.value().GetAsBoolean(&allow);
483 DCHECK(result); 484 DCHECK(result);
484 (*url_map)[GURL(it.key())] = allow; 485 (*url_map)[GURL(it.key())] = allow;
485 } 486 }
486 url_filter_context_.SetManualURLs(url_map.Pass()); 487 url_filter_context_.SetManualURLs(url_map.Pass());
487 } 488 }
OLDNEW
« no previous file with comments | « chrome/browser/managed_mode/managed_user_service.h ('k') | chrome/browser/resources/options/managed_user_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698