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

Side by Side Diff: chrome/browser/supervised_user/child_accounts/child_account_service.cc

Issue 988493002: Disable fetching account flags for signed in users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/child_accounts/child_account_service.h" 5 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 254 }
255 255
256 void ChildAccountService::ScheduleNextFamilyInfoUpdate(base::TimeDelta delay) { 256 void ChildAccountService::ScheduleNextFamilyInfoUpdate(base::TimeDelta delay) {
257 family_fetch_timer_.Start( 257 family_fetch_timer_.Start(
258 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo); 258 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo);
259 } 259 }
260 260
261 void ChildAccountService::StartFetchingServiceFlags() { 261 void ChildAccountService::StartFetchingServiceFlags() {
262 account_id_ = SigninManagerFactory::GetForProfile(profile_) 262 account_id_ = SigninManagerFactory::GetForProfile(profile_)
263 ->GetAuthenticatedAccountId(); 263 ->GetAuthenticatedAccountId();
264 flag_fetcher_.reset(new AccountServiceFlagFetcher(
265 account_id_,
266 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_),
267 profile_->GetRequestContext(),
268 base::Bind(&ChildAccountService::OnFlagsFetched,
269 weak_ptr_factory_.GetWeakPtr())));
270 } 264 }
271 265
272 void ChildAccountService::CancelFetchingServiceFlags() { 266 void ChildAccountService::CancelFetchingServiceFlags() {
273 flag_fetcher_.reset(); 267 flag_fetcher_.reset();
274 account_id_.clear(); 268 account_id_.clear();
275 flag_fetch_timer_.Stop(); 269 flag_fetch_timer_.Stop();
276 } 270 }
277 271
278 void ChildAccountService::OnFlagsFetched( 272 void ChildAccountService::OnFlagsFetched(
279 AccountServiceFlagFetcher::ResultCode result, 273 AccountServiceFlagFetcher::ResultCode result,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 command_line->AppendSwitch(switches::kEnableSupervisedUserBlacklist); 375 command_line->AppendSwitch(switches::kEnableSupervisedUserBlacklist);
382 376
383 // Query-based filtering also defaults to enabled. 377 // Query-based filtering also defaults to enabled.
384 bool has_enable_safesites = 378 bool has_enable_safesites =
385 command_line->HasSwitch(switches::kEnableSupervisedUserSafeSites); 379 command_line->HasSwitch(switches::kEnableSupervisedUserSafeSites);
386 bool has_disable_safesites = 380 bool has_disable_safesites =
387 command_line->HasSwitch(switches::kDisableSupervisedUserSafeSites); 381 command_line->HasSwitch(switches::kDisableSupervisedUserSafeSites);
388 if (!has_enable_safesites && !has_disable_safesites) 382 if (!has_enable_safesites && !has_disable_safesites)
389 command_line->AppendSwitch(switches::kEnableSupervisedUserSafeSites); 383 command_line->AppendSwitch(switches::kEnableSupervisedUserSafeSites);
390 } 384 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698