Commit 95799d60 authored by scheib@chromium.org's avatar scheib@chromium.org

bluetooth: Initial WebBluetooth & WebBluetoothError.

In three patches the initial mock implementation of bluetooth.requestDevice
is implemented across blink & content. This allows layout tests to specify the
data responses the mock implemented in content should return via
testRunner.SetBluetoothMockDataSet and call bluetooth.requestDevice with the
expected results.

crrev.com/650613005 blink::WebBluetooth & WebBluetoothError interfaces.
crrev.com/702593002 content::WebBluetoothImpl & testRunner.SetBluetoothMockDataSet.
crrev.com/686813003 blink::BluetoothDiscovery::requestDevice implemented.

BUG=420284

Review URL: https://codereview.chromium.org/650613005

git-svn-id: svn://svn.chromium.org/blink/trunk@184839 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3eefe3a4
......@@ -61,6 +61,7 @@ namespace blink {
class WebAudioBus;
class WebBlobRegistry;
class WebBluetooth;
class WebContentDecryptionModule;
class WebClipboard;
class WebCompositorSupport;
......@@ -639,6 +640,11 @@ public:
virtual WebGeofencingProvider* geofencingProvider() { return 0; }
// Bluetooth ----------------------------------------------------------
// Returns pointer to client owned WebBluetooth implementation.
virtual WebBluetooth* bluetooth() { return 0; }
protected:
virtual ~Platform() { }
};
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WebBluetooth_h
#define WebBluetooth_h
#include "public/platform/WebCallbacks.h"
namespace blink {
struct WebBluetoothError;
// FIXME: Return a WebBluetoothDevice http://crbug.com/420284
typedef WebCallbacks<void, WebBluetoothError> WebBluetoothRequestDeviceCallbacks;
class WebBluetooth {
public:
virtual ~WebBluetooth() { }
// Requests a bluetooth device.
// WebBluetoothRequestDeviceCallbacks ownership transferred to the client.
virtual void requestDevice(WebBluetoothRequestDeviceCallbacks*) = 0;
};
} // namespace blink
#endif // WebBluetooth_h
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WebBluetoothError_h
#define WebBluetoothError_h
#include "WebString.h"
namespace blink {
// Error object when a bluetooth request can not be satisfied.
struct WebBluetoothError {
enum ErrorType {
NotFoundError,
SecurityError
};
WebBluetoothError(ErrorType errorType, const WebString& message)
: errorType(errorType)
, message(message)
{
}
ErrorType errorType;
WebString message;
};
} // namespace blink
#endif // WebBluetoothError_h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment