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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/sim_unlock_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 // Pass PIN/PUK code to shill and check status. 199 // Pass PIN/PUK code to shill and check status.
200 void EnterCode(const std::string& code, SimUnlockCode code_type); 200 void EnterCode(const std::string& code, SimUnlockCode code_type);
201 201
202 // Methods to invoke shill PIN/PUK D-Bus operations. 202 // Methods to invoke shill PIN/PUK D-Bus operations.
203 void ChangeRequirePin(bool require_pin, const std::string& pin); 203 void ChangeRequirePin(bool require_pin, const std::string& pin);
204 void EnterPin(const std::string& pin); 204 void EnterPin(const std::string& pin);
205 void ChangePin(const std::string& old_pin, const std::string& new_pin); 205 void ChangePin(const std::string& old_pin, const std::string& new_pin);
206 void UnblockPin(const std::string& puk, const std::string& new_pin); 206 void UnblockPin(const std::string& puk, const std::string& new_pin);
207 void PinOperationSuccessCallback(const std::string& operation_name); 207 void PinOperationSuccessCallback(const std::string& operation_name);
208 void PinOperationErrorCallback(const std::string& operation_name, 208 void PinOperationErrorCallback(
209 const std::string& error_name, 209 const std::string& operation_name,
210 scoped_ptr<base::DictionaryValue> error_data); 210 const std::string& error_name,
211 std::unique_ptr<base::DictionaryValue> error_data);
211 212
212 // Called when an asynchronous PIN operation has completed. 213 // Called when an asynchronous PIN operation has completed.
213 void OnPinOperationCompleted(PinOperationError error); 214 void OnPinOperationCompleted(PinOperationError error);
214 215
215 // Single handler for PIN/PUK code operations. 216 // Single handler for PIN/PUK code operations.
216 void HandleEnterCode(SimUnlockCode code_type, const std::string& code); 217 void HandleEnterCode(SimUnlockCode code_type, const std::string& code);
217 218
218 // Handlers for JS WebUI messages. 219 // Handlers for JS WebUI messages.
219 void HandleChangePinCode(const base::ListValue* args); 220 void HandleChangePinCode(const base::ListValue* args);
220 void HandleEnterPinCode(const base::ListValue* args); 221 void HandleEnterPinCode(const base::ListValue* args);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 546
546 void SimUnlockHandler::PinOperationSuccessCallback( 547 void SimUnlockHandler::PinOperationSuccessCallback(
547 const std::string& operation_name) { 548 const std::string& operation_name) {
548 NET_LOG_DEBUG("Pin operation successful.", operation_name); 549 NET_LOG_DEBUG("Pin operation successful.", operation_name);
549 OnPinOperationCompleted(PIN_ERROR_NONE); 550 OnPinOperationCompleted(PIN_ERROR_NONE);
550 } 551 }
551 552
552 void SimUnlockHandler::PinOperationErrorCallback( 553 void SimUnlockHandler::PinOperationErrorCallback(
553 const std::string& operation_name, 554 const std::string& operation_name,
554 const std::string& error_name, 555 const std::string& error_name,
555 scoped_ptr<base::DictionaryValue> error_data) { 556 std::unique_ptr<base::DictionaryValue> error_data) {
556 NET_LOG_ERROR("Pin operation failed: " + error_name, operation_name); 557 NET_LOG_ERROR("Pin operation failed: " + error_name, operation_name);
557 PinOperationError pin_error; 558 PinOperationError pin_error;
558 if (error_name == NetworkDeviceHandler::kErrorIncorrectPin || 559 if (error_name == NetworkDeviceHandler::kErrorIncorrectPin ||
559 error_name == NetworkDeviceHandler::kErrorPinRequired) 560 error_name == NetworkDeviceHandler::kErrorPinRequired)
560 pin_error = PIN_ERROR_INCORRECT_CODE; 561 pin_error = PIN_ERROR_INCORRECT_CODE;
561 else if (error_name == NetworkDeviceHandler::kErrorPinBlocked) 562 else if (error_name == NetworkDeviceHandler::kErrorPinBlocked)
562 pin_error = PIN_ERROR_BLOCKED; 563 pin_error = PIN_ERROR_BLOCKED;
563 else 564 else
564 pin_error = PIN_ERROR_UNKNOWN; 565 pin_error = PIN_ERROR_UNKNOWN;
565 OnPinOperationCompleted(pin_error); 566 OnPinOperationCompleted(pin_error);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 SimUnlockHandler* handler = new SimUnlockHandler(); 764 SimUnlockHandler* handler = new SimUnlockHandler();
764 web_ui->AddMessageHandler(handler); 765 web_ui->AddMessageHandler(handler);
765 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); 766 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource();
766 767
767 // Set up the chrome://sim-unlock/ source. 768 // Set up the chrome://sim-unlock/ source.
768 Profile* profile = Profile::FromWebUI(web_ui); 769 Profile* profile = Profile::FromWebUI(web_ui);
769 content::URLDataSource::Add(profile, html_source); 770 content::URLDataSource::Add(profile, html_source);
770 } 771 }
771 772
772 } // namespace chromeos 773 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc ('k') | chrome/browser/ui/webui/chromeos/slow_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698