Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / content / browser / devtools / protocol / emulation_handler.h
blob5303663c107172717f95695116617f660109a87b
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
8 #include "content/browser/devtools/protocol/devtools_protocol_handler.h"
9 #include "content/browser/devtools/protocol/page_handler.h"
10 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
12 namespace content {
14 class RenderFrameHostImpl;
15 class WebContentsImpl;
17 namespace devtools {
19 namespace page { class PageHandler; }
21 namespace emulation {
23 class EmulationHandler : public page::PageHandler::ScreencastListener {
24 public:
25 using Response = DevToolsProtocolClient::Response;
27 explicit EmulationHandler(page::PageHandler* page_handler);
28 ~EmulationHandler() override;
30 // page::PageHandler::ScreencastListener implementation.
31 void ScreencastEnabledChanged() override;
33 void SetRenderFrameHost(RenderFrameHostImpl* host);
34 void Detached();
36 Response SetGeolocationOverride(double* latitude,
37 double* longitude,
38 double* accuracy);
39 Response ClearGeolocationOverride();
41 Response SetTouchEmulationEnabled(bool enabled,
42 const std::string* configuration);
44 Response CanEmulate(bool* result);
45 Response SetDeviceMetricsOverride(int width,
46 int height,
47 double device_scale_factor,
48 bool mobile,
49 bool fit_window,
50 const double* optional_scale,
51 const double* optional_offset_x,
52 const double* optional_offset_y);
53 Response ClearDeviceMetricsOverride();
55 private:
56 WebContentsImpl* GetWebContents();
57 void UpdateTouchEventEmulationState();
58 void UpdateDeviceEmulationState();
60 bool touch_emulation_enabled_;
61 std::string touch_emulation_configuration_;
63 bool device_emulation_enabled_;
64 blink::WebDeviceEmulationParams device_emulation_params_;
66 page::PageHandler* page_handler_;
67 RenderFrameHostImpl* host_;
69 DISALLOW_COPY_AND_ASSIGN(EmulationHandler);
72 } // namespace emulation
73 } // namespace devtools
74 } // namespace content
76 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_