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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 status_string = "pending"; | 83 status_string = "pending"; |
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()->CallJavascriptFunction("EasyUnlockTurnOffOverlay.updateUIState", | 93 web_ui()->CallJavascriptFunctionUnsafe( |
94 base::StringValue(status_string)); | 94 "EasyUnlockTurnOffOverlay.updateUIState", |
| 95 base::StringValue(status_string)); |
95 } | 96 } |
96 | 97 |
97 void EasyUnlockHandler::HandleGetTurnOffFlowStatus( | 98 void EasyUnlockHandler::HandleGetTurnOffFlowStatus( |
98 const base::ListValue* args) { | 99 const base::ListValue* args) { |
99 SendTurnOffOperationStatus(); | 100 SendTurnOffOperationStatus(); |
100 } | 101 } |
101 | 102 |
102 void EasyUnlockHandler::HandleRequestTurnOff(const base::ListValue* args) { | 103 void EasyUnlockHandler::HandleRequestTurnOff(const base::ListValue* args) { |
103 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->RunTurnOffFlow(); | 104 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->RunTurnOffFlow(); |
104 } | 105 } |
105 | 106 |
106 void EasyUnlockHandler::HandlePageDismissed(const base::ListValue* args) { | 107 void EasyUnlockHandler::HandlePageDismissed(const base::ListValue* args) { |
107 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->ResetTurnOffFlow(); | 108 EasyUnlockService::Get(Profile::FromWebUI(web_ui()))->ResetTurnOffFlow(); |
108 } | 109 } |
109 | 110 |
110 } // namespace options | 111 } // namespace options |
OLD | NEW |