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

Side by Side Diff: components/pairing/fake_controller_pairing_controller.h

Issue 865973003: Update {virtual,override,final} to follow C++11 style in components, round 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix format Created 5 years, 11 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 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 #ifndef COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_ 5 #ifndef COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
6 #define COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_ 6 #define COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 19 matching lines...) Expand all
30 // Supported options: 30 // Supported options:
31 // * async_duration - integer. Default: 3000. 31 // * async_duration - integer. Default: 3000.
32 // * fail_connecting - {0,1}. Default: 0. 32 // * fail_connecting - {0,1}. Default: 0.
33 // * connection_lost - integer-integer. Default: 0-0. 33 // * connection_lost - integer-integer. Default: 0-0.
34 // * fail_enrollment - {0,1}. Default: 0. 34 // * fail_enrollment - {0,1}. Default: 0.
35 // * discovery - {F,L,N}-string(~{F,L,N}-string)*. Default: 35 // * discovery - {F,L,N}-string(~{F,L,N}-string)*. Default:
36 // F-Device_1~F-Device_5~F-Device_3~L-Device_3~L-Device_1~F-Device_1 36 // F-Device_1~F-Device_5~F-Device_3~L-Device_3~L-Device_1~F-Device_1
37 // * code - 6 digits or empty string. Default: empty string. If strings is 37 // * code - 6 digits or empty string. Default: empty string. If strings is
38 // empty, random code is generated. 38 // empty, random code is generated.
39 explicit FakeControllerPairingController(const std::string& config); 39 explicit FakeControllerPairingController(const std::string& config);
40 virtual ~FakeControllerPairingController(); 40 ~FakeControllerPairingController() override;
41 41
42 // Applies given |config| to controller. 42 // Applies given |config| to controller.
43 void ApplyConfig(const std::string& config); 43 void ApplyConfig(const std::string& config);
44 44
45 // Sets delay for asynchronous operations. like device searching or host 45 // Sets delay for asynchronous operations. like device searching or host
46 // enrollment. Default value is 3 seconds. 46 // enrollment. Default value is 3 seconds.
47 void set_async_duration(base::TimeDelta async_duration) { 47 void set_async_duration(base::TimeDelta async_duration) {
48 async_duration_ = async_duration; 48 async_duration_ = async_duration;
49 } 49 }
50 50
51 // Causing an error on |STAGE_ESTABLISHING_CONNECTION| stage once. 51 // Causing an error on |STAGE_ESTABLISHING_CONNECTION| stage once.
52 void SetShouldFailOnConnecting(); 52 void SetShouldFailOnConnecting();
53 53
54 // Causing a connection loss on |stage_begin| and a connection recovery 54 // Causing a connection loss on |stage_begin| and a connection recovery
55 // on |stage_end| once. 55 // on |stage_end| once.
56 void SetShouldLoseConnection(Stage stage_begin, Stage stage_end); 56 void SetShouldLoseConnection(Stage stage_begin, Stage stage_end);
57 57
58 // Makes host enrollment to fail once. 58 // Makes host enrollment to fail once.
59 void SetEnrollmentShouldFail(); 59 void SetEnrollmentShouldFail();
60 60
61 // Sets devices discovery scenario for |STAGE_DEVICES_DESCOVERY| stage. 61 // Sets devices discovery scenario for |STAGE_DEVICES_DESCOVERY| stage.
62 // Events are executed with interval of |async_duration_|. 62 // Events are executed with interval of |async_duration_|.
63 // For default scenario refer to implementation. 63 // For default scenario refer to implementation.
64 void SetDiscoveryScenario(const DiscoveryScenario& discovery_scenario); 64 void SetDiscoveryScenario(const DiscoveryScenario& discovery_scenario);
65 65
66 // Overridden from ControllerPairingController: 66 // Overridden from ControllerPairingController:
67 virtual void AddObserver(Observer* observer) override; 67 void AddObserver(Observer* observer) override;
68 virtual void RemoveObserver(Observer* observer) override; 68 void RemoveObserver(Observer* observer) override;
69 virtual Stage GetCurrentStage() override; 69 Stage GetCurrentStage() override;
70 virtual void StartPairing() override; 70 void StartPairing() override;
71 virtual DeviceIdList GetDiscoveredDevices() override; 71 DeviceIdList GetDiscoveredDevices() override;
72 virtual void ChooseDeviceForPairing(const std::string& device_id) override; 72 void ChooseDeviceForPairing(const std::string& device_id) override;
73 virtual void RepeatDiscovery() override; 73 void RepeatDiscovery() override;
74 virtual std::string GetConfirmationCode() override; 74 std::string GetConfirmationCode() override;
75 virtual void SetConfirmationCodeIsCorrect(bool correct) override; 75 void SetConfirmationCodeIsCorrect(bool correct) override;
76 virtual void SetHostConfiguration( 76 void SetHostConfiguration(bool accepted_eula,
77 bool accepted_eula, 77 const std::string& lang,
78 const std::string& lang, 78 const std::string& timezone,
79 const std::string& timezone, 79 bool send_reports,
80 bool send_reports, 80 const std::string& keyboard_layout) override;
81 const std::string& keyboard_layout) override; 81 void OnAuthenticationDone(const std::string& domain,
82 virtual void OnAuthenticationDone(const std::string& domain, 82 const std::string& auth_token) override;
83 const std::string& auth_token) override; 83 void StartSession() override;
84 virtual void StartSession() override;
85 84
86 private: 85 private:
87 void ChangeStage(Stage new_stage); 86 void ChangeStage(Stage new_stage);
88 void ChangeStageLater(Stage new_stage); 87 void ChangeStageLater(Stage new_stage);
89 void ExecuteDiscoveryEvent(size_t event_position); 88 void ExecuteDiscoveryEvent(size_t event_position);
90 void DeviceFound(const std::string& device_id); 89 void DeviceFound(const std::string& device_id);
91 void DeviceLost(const std::string& device_id); 90 void DeviceLost(const std::string& device_id);
92 91
93 // Overridden from ui::ControllerPairingController::Observer: 92 // Overridden from ui::ControllerPairingController::Observer:
94 virtual void PairingStageChanged(Stage new_stage) override; 93 void PairingStageChanged(Stage new_stage) override;
95 virtual void DiscoveredDevicesListChanged() override; 94 void DiscoveredDevicesListChanged() override;
96 95
97 ObserverList<ControllerPairingController::Observer> observers_; 96 ObserverList<ControllerPairingController::Observer> observers_;
98 Stage current_stage_; 97 Stage current_stage_;
99 std::string confirmation_code_; 98 std::string confirmation_code_;
100 std::string preset_confirmation_code_; 99 std::string preset_confirmation_code_;
101 base::TimeDelta async_duration_; 100 base::TimeDelta async_duration_;
102 DiscoveryScenario discovery_scenario_; 101 DiscoveryScenario discovery_scenario_;
103 std::set<std::string> discovered_devices_; 102 std::set<std::string> discovered_devices_;
104 std::string choosen_device_; 103 std::string choosen_device_;
105 bool should_fail_on_connecting_; 104 bool should_fail_on_connecting_;
106 Stage connection_lost_begin_; 105 Stage connection_lost_begin_;
107 Stage connection_lost_end_; 106 Stage connection_lost_end_;
108 bool enrollment_should_fail_; 107 bool enrollment_should_fail_;
109 108
110 DISALLOW_COPY_AND_ASSIGN(FakeControllerPairingController); 109 DISALLOW_COPY_AND_ASSIGN(FakeControllerPairingController);
111 }; 110 };
112 111
113 } // namespace pairing_chromeos 112 } // namespace pairing_chromeos
114 113
115 #endif // COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_ 114 #endif // COMPONENTS_PAIRING_FAKE_CONTROLLER_PAIRING_CONTROLLER_H_
OLDNEW
« no previous file with comments | « components/pairing/bluetooth_host_pairing_controller.h ('k') | components/pairing/fake_host_pairing_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698