diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-01-09 17:51:23 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-01-09 17:51:23 -0800 |
commit | e933faefa1e899dbd5bf371f499cc682aff46c83 (patch) | |
tree | 8fb31ff5c9a41aec9912d0253be7ef0445e2f58a /WebKit/android/wds/client/Device.h | |
parent | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (diff) | |
download | external_webkit-e933faefa1e899dbd5bf371f499cc682aff46c83.zip external_webkit-e933faefa1e899dbd5bf371f499cc682aff46c83.tar.gz external_webkit-e933faefa1e899dbd5bf371f499cc682aff46c83.tar.bz2 |
auto import from //branches/cupcake/...@125939
Diffstat (limited to 'WebKit/android/wds/client/Device.h')
-rw-r--r-- | WebKit/android/wds/client/Device.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/WebKit/android/wds/client/Device.h b/WebKit/android/wds/client/Device.h new file mode 100644 index 0000000..c6d77f3 --- /dev/null +++ b/WebKit/android/wds/client/Device.h @@ -0,0 +1,53 @@ +/* + * Copyright 2009, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WDS_DEVICE_H +#define WDS_DEVICE_H + +#include <stdlib.h> + +class AdbConnection; + +class Device { +public: + // Type of device. + // TODO: Add simulator support + enum DeviceType { + NONE = -1, + EMULATOR, + DEVICE + }; + + // Takes ownership of name + Device(char* name, DeviceType type, const AdbConnection* conn) + : m_connection(conn) + , m_name(strdup(name)) + , m_type(type) {} + ~Device() { free(m_name); } + + const char* name() const { return m_name; } + DeviceType type() const { return m_type; } + + // Send a request to this device. + bool sendRequest(const char* req) const; + +private: + const AdbConnection* m_connection; + char* m_name; + DeviceType m_type; +}; + +#endif |