| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ | 6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 const SetPTZCompleteCallback& callback) override; | 107 const SetPTZCompleteCallback& callback) override; |
| 108 void SetTiltDirection(TiltDirection direction, | 108 void SetTiltDirection(TiltDirection direction, |
| 109 int tilt_speed, | 109 int tilt_speed, |
| 110 const SetPTZCompleteCallback& callback) override; | 110 const SetPTZCompleteCallback& callback) override; |
| 111 void Reset(bool pan, | 111 void Reset(bool pan, |
| 112 bool tilt, | 112 bool tilt, |
| 113 bool zoom, | 113 bool zoom, |
| 114 const SetPTZCompleteCallback& callback) override; | 114 const SetPTZCompleteCallback& callback) override; |
| 115 | 115 |
| 116 // Used only in unit tests in place of Open(). | 116 // Used only in unit tests in place of Open(). |
| 117 void OpenForTesting(scoped_ptr<SerialConnection> serial_connection); | 117 void OpenForTesting(std::unique_ptr<SerialConnection> serial_connection); |
| 118 | 118 |
| 119 // Used only in unit tests to retrieve |serial_connection_| since this class | 119 // Used only in unit tests to retrieve |serial_connection_| since this class |
| 120 // owns it. | 120 // owns it. |
| 121 SerialConnection* GetSerialConnectionForTesting(); | 121 SerialConnection* GetSerialConnectionForTesting(); |
| 122 | 122 |
| 123 scoped_ptr<SerialConnection> serial_connection_; | 123 std::unique_ptr<SerialConnection> serial_connection_; |
| 124 | 124 |
| 125 // Stores the response for the current command. | 125 // Stores the response for the current command. |
| 126 std::vector<char> data_buffer_; | 126 std::vector<char> data_buffer_; |
| 127 | 127 |
| 128 // Queues commands till the current command completes. | 128 // Queues commands till the current command completes. |
| 129 std::deque<std::pair<std::vector<char>, CommandCompleteCallback>> commands_; | 129 std::deque<std::pair<std::vector<char>, CommandCompleteCallback>> commands_; |
| 130 | 130 |
| 131 // Visca webcam always get/set pan-tilt together. |pan| and |tilt| are used to | 131 // Visca webcam always get/set pan-tilt together. |pan| and |tilt| are used to |
| 132 // store the current value of pan and tilt positions. | 132 // store the current value of pan and tilt positions. |
| 133 int pan_; | 133 int pan_; |
| 134 int tilt_; | 134 int tilt_; |
| 135 | 135 |
| 136 base::WeakPtrFactory<ViscaWebcam> weak_ptr_factory_; | 136 base::WeakPtrFactory<ViscaWebcam> weak_ptr_factory_; |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(ViscaWebcam); | 138 DISALLOW_COPY_AND_ASSIGN(ViscaWebcam); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace extensions | 141 } // namespace extensions |
| 142 | 142 |
| 143 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ | 143 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ |
| OLD | NEW |