Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: content/browser/devtools/protocol/emulation_handler.h

Issue 1014403002: [DevTools] Emulation domain implementation (browser side). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/devtools/protocol/emulation_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
7 7
8 #include "content/browser/devtools/protocol/devtools_protocol_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"
9 11
10 namespace content { 12 namespace content {
13
14 class RenderViewHostImpl;
15
11 namespace devtools { 16 namespace devtools {
17
18 namespace page { class PageHandler; }
19
12 namespace emulation { 20 namespace emulation {
13 21
14 class EmulationHandler { 22 class EmulationHandler : public page::PageHandler::ScreencastListener {
15 public: 23 public:
16 using Response = DevToolsProtocolClient::Response; 24 using Response = DevToolsProtocolClient::Response;
17 25
18 EmulationHandler(); 26 explicit EmulationHandler(page::PageHandler* page_handler);
19 virtual ~EmulationHandler(); 27 ~EmulationHandler() override;
28
29 // page::PageHandler::ScreencastListener implementation.
30 void ScreencastEnabledChanged() override;
31
32 void SetRenderViewHost(RenderViewHostImpl* host);
33 void Detached();
20 34
21 Response SetGeolocationOverride(double* latitude, 35 Response SetGeolocationOverride(double* latitude,
22 double* longitude, 36 double* longitude,
23 double* accuracy); 37 double* accuracy);
24 Response ClearGeolocationOverride(); 38 Response ClearGeolocationOverride();
25 39
26 Response SetTouchEmulationEnabled(bool enabled, 40 Response SetTouchEmulationEnabled(bool enabled,
27 const std::string* configuration); 41 const std::string* configuration);
28 42
29 Response CanEmulate(bool* result); 43 Response CanEmulate(bool* result);
30 Response SetDeviceMetricsOverride(int width, 44 Response SetDeviceMetricsOverride(int width,
31 int height, 45 int height,
32 double device_scale_factor, 46 double device_scale_factor,
33 bool mobile, 47 bool mobile,
34 bool fit_window, 48 bool fit_window,
35 const double* optional_scale, 49 const double* optional_scale,
36 const double* optional_offset_x, 50 const double* optional_offset_x,
37 const double* optional_offset_y); 51 const double* optional_offset_y);
38 Response ClearDeviceMetricsOverride(); 52 Response ClearDeviceMetricsOverride();
39 53
40 void SetClient(scoped_ptr<DevToolsProtocolClient> client); 54 private:
55 void UpdateTouchEventEmulationState();
56 void UpdateDeviceEmulationState();
41 57
42 private: 58 bool touch_emulation_enabled_;
59 std::string touch_emulation_configuration_;
60
61 bool device_emulation_enabled_;
62 blink::WebDeviceEmulationParams device_emulation_params_;
63
64 page::PageHandler* page_handler_;
65 RenderViewHostImpl* host_;
66
43 DISALLOW_COPY_AND_ASSIGN(EmulationHandler); 67 DISALLOW_COPY_AND_ASSIGN(EmulationHandler);
44 }; 68 };
45 69
46 } // namespace emulation 70 } // namespace emulation
47 } // namespace devtools 71 } // namespace devtools
48 } // namespace content 72 } // namespace content
49 73
50 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_ 74 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/protocol/emulation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698