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

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

Issue 999793003: Returning fetching back. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo); 299 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo);
300 } 300 }
301 301
302 void ChildAccountService::StartFetchingServiceFlags() { 302 void ChildAccountService::StartFetchingServiceFlags() {
303 if (!IsChildAccountDetectionEnabled()) { 303 if (!IsChildAccountDetectionEnabled()) {
304 SetIsChildAccount(false); 304 SetIsChildAccount(false);
305 return; 305 return;
306 } 306 }
307 account_id_ = SigninManagerFactory::GetForProfile(profile_) 307 account_id_ = SigninManagerFactory::GetForProfile(profile_)
308 ->GetAuthenticatedAccountId(); 308 ->GetAuthenticatedAccountId();
309 flag_fetcher_.reset(new AccountServiceFlagFetcher(
310 account_id_,
311 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_),
312 profile_->GetRequestContext(),
313 base::Bind(&ChildAccountService::OnFlagsFetched,
314 weak_ptr_factory_.GetWeakPtr())));
309 } 315 }
310 316
311 void ChildAccountService::CancelFetchingServiceFlags() { 317 void ChildAccountService::CancelFetchingServiceFlags() {
312 flag_fetcher_.reset(); 318 flag_fetcher_.reset();
313 account_id_.clear(); 319 account_id_.clear();
314 flag_fetch_timer_.Stop(); 320 flag_fetch_timer_.Stop();
315 } 321 }
316 322
317 void ChildAccountService::OnFlagsFetched( 323 void ChildAccountService::OnFlagsFetched(
318 AccountServiceFlagFetcher::ResultCode result, 324 AccountServiceFlagFetcher::ResultCode result,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 command_line->AppendSwitch(switches::kEnableSupervisedUserBlacklist); 437 command_line->AppendSwitch(switches::kEnableSupervisedUserBlacklist);
432 438
433 // Query-based filtering also defaults to enabled. 439 // Query-based filtering also defaults to enabled.
434 bool has_enable_safesites = 440 bool has_enable_safesites =
435 command_line->HasSwitch(switches::kEnableSupervisedUserSafeSites); 441 command_line->HasSwitch(switches::kEnableSupervisedUserSafeSites);
436 bool has_disable_safesites = 442 bool has_disable_safesites =
437 command_line->HasSwitch(switches::kDisableSupervisedUserSafeSites); 443 command_line->HasSwitch(switches::kDisableSupervisedUserSafeSites);
438 if (!has_enable_safesites && !has_disable_safesites) 444 if (!has_enable_safesites && !has_disable_safesites)
439 command_line->AppendSwitch(switches::kEnableSupervisedUserSafeSites); 445 command_line->AppendSwitch(switches::kEnableSupervisedUserSafeSites);
440 } 446 }
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