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

Side by Side Diff: chrome/browser/chromeos/login/screens/base_screen.cc

Issue 2870203003: Make Hands-Off Zero-Touch Enrollment compatibile with tests (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/screens/base_screen.h" 5 #include "chrome/browser/chromeos/login/screens/base_screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" 8 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h"
9 #include "chrome/browser/chromeos/login/screens/model_view_channel.h" 9 #include "chrome/browser/chromeos/login/screens/model_view_channel.h"
10 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
10 11
11 namespace chromeos { 12 namespace chromeos {
12 13
13 BaseScreen::ContextEditor::ContextEditor(BaseScreen& screen) 14 BaseScreen::ContextEditor::ContextEditor(BaseScreen& screen)
14 : screen_(screen), context_(screen.context_) { 15 : screen_(screen), context_(screen.context_) {
15 } 16 }
16 17
17 BaseScreen::ContextEditor::~ContextEditor() { 18 BaseScreen::ContextEditor::~ContextEditor() {
18 screen_.CommitContextChanges(); 19 screen_.CommitContextChanges();
19 } 20 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return ContextEditor(*this); 119 return ContextEditor(*this);
119 } 120 }
120 121
121 void BaseScreen::OnContextChanged(const base::DictionaryValue& diff) { 122 void BaseScreen::OnContextChanged(const base::DictionaryValue& diff) {
122 std::vector<::login::ScreenContext::KeyType> keys; 123 std::vector<::login::ScreenContext::KeyType> keys;
123 context_.ApplyChanges(diff, &keys); 124 context_.ApplyChanges(diff, &keys);
124 for (const auto& key : keys) 125 for (const auto& key : keys)
125 OnContextKeyUpdated(key); 126 OnContextKeyUpdated(key);
126 } 127 }
127 128
129 bool BaseScreen::UsingHandsOffEnrollment() {
xiyuan 2017/05/09 22:03:52 This does not feel belong here. Can we put it some
kumarniranjan 2017/05/09 22:49:47 Done.
130 return policy::DeviceCloudPolicyManagerChromeOS::
131 GetZeroTouchEnrollmentMode() ==
132 policy::ZeroTouchEnrollmentMode::HANDS_OFF;
133 }
134
128 } // namespace chromeos 135 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698