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

Unified Diff: content/browser/devtools/protocol/page_handler.h

Issue 1003113003: [DevTools] Handle emulation in embedder, call into web API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/page_handler.h
diff --git a/content/browser/devtools/protocol/page_handler.h b/content/browser/devtools/protocol/page_handler.h
index 4ddb67d3d0c55b4d7ce048b0c4e3bd2415a3f693..f5035bae32a5ac5877545aa8b78cd960789d40b4 100644
--- a/content/browser/devtools/protocol/page_handler.h
+++ b/content/browser/devtools/protocol/page_handler.h
@@ -12,6 +12,7 @@
#include "cc/output/compositor_frame_metadata.h"
#include "content/browser/devtools/protocol/devtools_protocol_handler.h"
#include "content/public/browser/readback_types.h"
+#include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
class SkBitmap;
@@ -66,9 +67,18 @@ class PageHandler {
Response CaptureScreenshot(DevToolsCommandId command_id);
- Response CanScreencast(bool* result);
Response CanEmulate(bool* result);
+ Response SetDeviceMetricsOverride(int width,
+ int height,
+ double device_scale_factor,
+ bool mobile,
+ bool fit_window,
+ const double* optional_scale,
+ const double* optional_offset_x,
+ const double* optional_offset_y);
+ Response ClearDeviceMetricsOverride();
+ Response CanScreencast(bool* result);
Response StartScreencast(const std::string* format,
const int* quality,
const int* max_width,
@@ -89,6 +99,7 @@ class PageHandler {
private:
void UpdateTouchEventEmulationState();
+ void UpdateDeviceEmulationState();
void NotifyScreencastVisibility(bool visible);
void InnerSwapCompositorFrame();
@@ -110,9 +121,13 @@ class PageHandler {
scoped_refptr<StopRecordingFramesResponse> response_data);
bool enabled_;
+
bool touch_emulation_enabled_;
std::string touch_emulation_configuration_;
+ bool device_emulation_enabled_;
+ blink::WebDeviceEmulationParams device_emulation_params_;
+
bool screencast_enabled_;
std::string screencast_format_;
int screencast_quality_;

Powered by Google App Engine
This is Rietveld 408576698