| OLD | NEW |
| 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/ui/webui/options/easy_unlock_handler.h" | 5 #include "chrome/browser/ui/webui/options/easy_unlock_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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 break; | 84 break; |
| 85 case EasyUnlockService::FAIL: | 85 case EasyUnlockService::FAIL: |
| 86 status_string = "server-error"; | 86 status_string = "server-error"; |
| 87 break; | 87 break; |
| 88 default: | 88 default: |
| 89 LOG(ERROR) << "Unknown Easy unlock turn-off operation status: " << status; | 89 LOG(ERROR) << "Unknown Easy unlock turn-off operation status: " << status; |
| 90 status_string = "idle"; | 90 status_string = "idle"; |
| 91 break; | 91 break; |
| 92 } | 92 } |
| 93 web_ui()->CallJavascriptFunctionUnsafe( | 93 web_ui()->CallJavascriptFunctionUnsafe( |
| 94 "EasyUnlockTurnOffOverlay.updateUIState", | 94 "EasyUnlockTurnOffOverlay.updateUIState", base::Value(status_string)); |
| 95 base::StringValue(status_string)); | |
| 96 } | 95 } |
| 97 | 96 |
| 98 void EasyUnlockHandler::HandleGetTurnOffFlowStatus( | 97 void EasyUnlockHandler::HandleGetTurnOffFlowStatus( |
| 99 const base::ListValue* args) { | 98 const base::ListValue* args) { |
| 100 SendTurnOffOperationStatus(); | 99 SendTurnOffOperationStatus(); |
| 101 } | 100 } |
| 102 | 101 |
| 103 void EasyUnlockHandler::HandleRequestTurnOff(const base::ListValue* args) { | 102 void EasyUnlockHandler::HandleRequestTurnOff(const base::ListValue* args) { |
| 104 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->RunTurnOffFlow(); | 103 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->RunTurnOffFlow(); |
| 105 } | 104 } |
| 106 | 105 |
| 107 void EasyUnlockHandler::HandlePageDismissed(const base::ListValue* args) { | 106 void EasyUnlockHandler::HandlePageDismissed(const base::ListValue* args) { |
| 108 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->ResetTurnOffFlow(); | 107 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->ResetTurnOffFlow(); |
| 109 } | 108 } |
| 110 | 109 |
| 111 } // namespace options | 110 } // namespace options |
| OLD | NEW |