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

Side by Side Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 546163005: easy-unlock: Make policy fully override field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc » ('j') | 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/signin/easy_unlock_service.h" 5 #include "chrome/browser/signin/easy_unlock_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 #if defined(OS_CHROMEOS) 189 #if defined(OS_CHROMEOS)
190 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser()) 190 if (!user_manager::UserManager::Get()->IsLoggedInAsRegularUser())
191 return false; 191 return false;
192 192
193 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile_)) 193 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile_))
194 return false; 194 return false;
195 195
196 if (!profile_->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed)) 196 if (!profile_->GetPrefs()->GetBoolean(prefs::kEasyUnlockAllowed))
197 return false; 197 return false;
198 198
199 // It is disabled when the trial exists and is in "Disable" group. 199 // Respect existing policy and skip finch test.
200 if (base::FieldTrialList::FindFullName("EasyUnlock") == "Disable") 200 if (!profile_->GetPrefs()->IsManagedPreference(prefs::kEasyUnlockAllowed)) {
201 return false; 201 // It is disabled when the trial exists and is in "Disable" group.
202 if (base::FieldTrialList::FindFullName("EasyUnlock") == "Disable")
203 return false;
204 }
202 205
203 if (!bluetooth_detector_->IsPresent()) 206 if (!bluetooth_detector_->IsPresent())
204 return false; 207 return false;
205 208
206 return true; 209 return true;
207 #else 210 #else
208 // TODO(xiyuan): Revisit when non-chromeos platforms are supported. 211 // TODO(xiyuan): Revisit when non-chromeos platforms are supported.
209 return false; 212 return false;
210 #endif 213 #endif
211 } 214 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // Make sure lock screen state set by the extension gets reset. 437 // Make sure lock screen state set by the extension gets reset.
435 screenlock_state_handler_.reset(); 438 screenlock_state_handler_.reset();
436 439
437 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) { 440 if (GetComponentLoader(profile_)->Exists(extension_misc::kEasyUnlockAppId)) {
438 extensions::ExtensionSystem* extension_system = 441 extensions::ExtensionSystem* extension_system =
439 extensions::ExtensionSystem::Get(profile_); 442 extensions::ExtensionSystem::Get(profile_);
440 extension_system->extension_service()->ReloadExtension( 443 extension_system->extension_service()->ReloadExtension(
441 extension_misc::kEasyUnlockAppId); 444 extension_misc::kEasyUnlockAppId);
442 } 445 }
443 } 446 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698