OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_service.h" | 5 #include "chrome/browser/supervised_user/supervised_user_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 #include "chrome/browser/ui/browser_list.h" | 36 #include "chrome/browser/ui/browser_list.h" |
37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
39 #include "chrome/grit/generated_resources.h" | 39 #include "chrome/grit/generated_resources.h" |
40 #include "components/pref_registry/pref_registry_syncable.h" | 40 #include "components/pref_registry/pref_registry_syncable.h" |
41 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 41 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
42 #include "components/signin/core/browser/signin_manager.h" | 42 #include "components/signin/core/browser/signin_manager.h" |
43 #include "components/signin/core/browser/signin_manager_base.h" | 43 #include "components/signin/core/browser/signin_manager_base.h" |
44 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
45 #include "content/public/browser/user_metrics.h" | 45 #include "content/public/browser/user_metrics.h" |
46 #include "net/url_request/url_request_context_getter.h" | |
46 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
47 | 48 |
48 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
49 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 50 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
50 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 51 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
51 #include "components/user_manager/user_manager.h" | 52 #include "components/user_manager/user_manager.h" |
52 #endif | 53 #endif |
53 | 54 |
54 #if defined(ENABLE_EXTENSIONS) | 55 #if defined(ENABLE_EXTENSIONS) |
55 #include "chrome/browser/extensions/extension_service.h" | 56 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 } | 167 } |
167 | 168 |
168 void SupervisedUserService::URLFilterContext::InitAsyncURLChecker( | 169 void SupervisedUserService::URLFilterContext::InitAsyncURLChecker( |
169 net::URLRequestContextGetter* context, | 170 net::URLRequestContextGetter* context, |
170 const std::string& cx) { | 171 const std::string& cx) { |
171 ui_url_filter_->InitAsyncURLChecker(context, cx); | 172 ui_url_filter_->InitAsyncURLChecker(context, cx); |
172 BrowserThread::PostTask( | 173 BrowserThread::PostTask( |
173 BrowserThread::IO, | 174 BrowserThread::IO, |
174 FROM_HERE, | 175 FROM_HERE, |
175 base::Bind(&SupervisedUserURLFilter::InitAsyncURLChecker, | 176 base::Bind(&SupervisedUserURLFilter::InitAsyncURLChecker, |
176 io_url_filter_, context, cx)); | 177 io_url_filter_, base::Unretained(context), cx)); |
Bernhard Bauer
2015/01/05 10:22:33
Is base::Unretained necessary for raw pointers aft
Alexander Alekseev
2015/01/15 18:59:02
This is actually a refcounted pointer, but here it
| |
177 } | 178 } |
178 | 179 |
179 SupervisedUserService::SupervisedUserService(Profile* profile) | 180 SupervisedUserService::SupervisedUserService(Profile* profile) |
180 : includes_sync_sessions_type_(true), | 181 : includes_sync_sessions_type_(true), |
181 profile_(profile), | 182 profile_(profile), |
182 active_(false), | 183 active_(false), |
183 delegate_(NULL), | 184 delegate_(NULL), |
184 #if defined(ENABLE_EXTENSIONS) | 185 #if defined(ENABLE_EXTENSIONS) |
185 extension_registry_observer_(this), | 186 extension_registry_observer_(this), |
186 #endif | 187 #endif |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 // The active user can be NULL in unit tests. | 997 // The active user can be NULL in unit tests. |
997 if (user_manager::UserManager::Get()->GetActiveUser()) { | 998 if (user_manager::UserManager::Get()->GetActiveUser()) { |
998 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( | 999 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( |
999 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); | 1000 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); |
1000 } | 1001 } |
1001 return std::string(); | 1002 return std::string(); |
1002 #else | 1003 #else |
1003 return profile_->GetPrefs()->GetString(prefs::kProfileName); | 1004 return profile_->GetPrefs()->GetString(prefs::kProfileName); |
1004 #endif | 1005 #endif |
1005 } | 1006 } |
OLD | NEW |