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

Side by Side Diff: chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ui/webui/settings/chromeos/easy_unlock_settings_handler .h" 5 #include "chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler .h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void EasyUnlockSettingsHandler::OnTurnOffOperationStatusChanged() { 88 void EasyUnlockSettingsHandler::OnTurnOffOperationStatusChanged() {
89 CallJavascriptFunction("cr.webUIListenerCallback", 89 CallJavascriptFunction("cr.webUIListenerCallback",
90 base::StringValue("easy-unlock-turn-off-flow-status"), 90 base::StringValue("easy-unlock-turn-off-flow-status"),
91 base::StringValue(GetTurnOffFlowStatus())); 91 base::StringValue(GetTurnOffFlowStatus()));
92 } 92 }
93 93
94 void EasyUnlockSettingsHandler::SendEnabledStatus() { 94 void EasyUnlockSettingsHandler::SendEnabledStatus() {
95 CallJavascriptFunction( 95 CallJavascriptFunction(
96 "cr.webUIListenerCallback", 96 "cr.webUIListenerCallback",
97 base::StringValue("easy-unlock-enabled-status"), 97 base::StringValue("easy-unlock-enabled-status"),
98 base::FundamentalValue(EasyUnlockService::Get(profile_)->IsEnabled())); 98 base::Value(EasyUnlockService::Get(profile_)->IsEnabled()));
99 } 99 }
100 100
101 std::string EasyUnlockSettingsHandler::GetTurnOffFlowStatus() { 101 std::string EasyUnlockSettingsHandler::GetTurnOffFlowStatus() {
102 EasyUnlockService::TurnOffFlowStatus status = 102 EasyUnlockService::TurnOffFlowStatus status =
103 EasyUnlockService::Get(profile_)->GetTurnOffFlowStatus(); 103 EasyUnlockService::Get(profile_)->GetTurnOffFlowStatus();
104 104
105 // Translate status into JS UI state string. Note the translated string 105 // Translate status into JS UI state string. Note the translated string
106 // should match UIState defined in easy_unlock_turn_off_dialog.js. 106 // should match UIState defined in easy_unlock_turn_off_dialog.js.
107 std::string status_string; 107 std::string status_string;
108 switch (status) { 108 switch (status) {
(...skipping 17 matching lines...) Expand all
126 126
127 void EasyUnlockSettingsHandler::HandleGetEnabledStatus( 127 void EasyUnlockSettingsHandler::HandleGetEnabledStatus(
128 const base::ListValue* args) { 128 const base::ListValue* args) {
129 AllowJavascript(); 129 AllowJavascript();
130 130
131 CHECK_EQ(1U, args->GetSize()); 131 CHECK_EQ(1U, args->GetSize());
132 const base::Value* callback_id; 132 const base::Value* callback_id;
133 CHECK(args->Get(0, &callback_id)); 133 CHECK(args->Get(0, &callback_id));
134 ResolveJavascriptCallback( 134 ResolveJavascriptCallback(
135 *callback_id, 135 *callback_id,
136 base::FundamentalValue(EasyUnlockService::Get(profile_)->IsEnabled())); 136 base::Value(EasyUnlockService::Get(profile_)->IsEnabled()));
137 } 137 }
138 138
139 void EasyUnlockSettingsHandler::HandleStartTurnOnFlow( 139 void EasyUnlockSettingsHandler::HandleStartTurnOnFlow(
140 const base::ListValue* args) { 140 const base::ListValue* args) {
141 EasyUnlockService::Get(profile_)->LaunchSetup(); 141 EasyUnlockService::Get(profile_)->LaunchSetup();
142 } 142 }
143 143
144 void EasyUnlockSettingsHandler::HandleGetTurnOffFlowStatus( 144 void EasyUnlockSettingsHandler::HandleGetTurnOffFlowStatus(
145 const base::ListValue* args) { 145 const base::ListValue* args) {
146 CHECK_EQ(1U, args->GetSize()); 146 CHECK_EQ(1U, args->GetSize());
147 const base::Value* callback_id; 147 const base::Value* callback_id;
148 CHECK(args->Get(0, &callback_id)); 148 CHECK(args->Get(0, &callback_id));
149 ResolveJavascriptCallback(*callback_id, 149 ResolveJavascriptCallback(*callback_id,
150 base::StringValue(GetTurnOffFlowStatus())); 150 base::StringValue(GetTurnOffFlowStatus()));
151 } 151 }
152 152
153 void EasyUnlockSettingsHandler::HandleStartTurnOffFlow( 153 void EasyUnlockSettingsHandler::HandleStartTurnOffFlow(
154 const base::ListValue* args) { 154 const base::ListValue* args) {
155 EasyUnlockService::Get(profile_)->RunTurnOffFlow(); 155 EasyUnlockService::Get(profile_)->RunTurnOffFlow();
156 } 156 }
157 157
158 void EasyUnlockSettingsHandler::HandleCancelTurnOffFlow( 158 void EasyUnlockSettingsHandler::HandleCancelTurnOffFlow(
159 const base::ListValue* args) { 159 const base::ListValue* args) {
160 EasyUnlockService::Get(profile_)->ResetTurnOffFlow(); 160 EasyUnlockService::Get(profile_)->ResetTurnOffFlow();
161 } 161 }
162 162
163 } // namespace settings 163 } // namespace settings
164 } // namespace chromeos 164 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc ('k') | chrome/browser/ui/webui/settings/font_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698