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
3// found in the LICENSE file.
4
5#ifndef DeviceOrientationInspectorAgent_h
6#define DeviceOrientationInspectorAgent_h
7
8#include "core/inspector/InspectorBaseAgent.h"
9#include "wtf/text/WTFString.h"
10
11namespace blink {
12
13class DeviceOrientationController;
14class Page;
15
16typedef String ErrorString;
17
18class DeviceOrientationInspectorAgent FINAL : public InspectorBaseAgent<DeviceOrientationInspectorAgent>, public InspectorBackendDispatcher::DeviceOrientationCommandHandler {
19    WTF_MAKE_NONCOPYABLE(DeviceOrientationInspectorAgent);
20public:
21    static void provideTo(Page&);
22
23    virtual ~DeviceOrientationInspectorAgent();
24
25    // Protocol methods.
26    virtual void setDeviceOrientationOverride(ErrorString*, double, double, double) OVERRIDE;
27    virtual void clearDeviceOrientationOverride(ErrorString*) OVERRIDE;
28
29    // Inspector Controller API.
30    virtual void clearFrontend() OVERRIDE;
31    virtual void restore() OVERRIDE;
32    virtual void didCommitLoadForMainFrame() OVERRIDE;
33
34private:
35    explicit DeviceOrientationInspectorAgent(Page&);
36    DeviceOrientationController& controller();
37    Page& m_page;
38};
39
40} // namespace blink
41
42
43#endif // !defined(DeviceOrientationInspectorAgent_h)
44