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

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

Issue 2548263002: [DevTools] Migrate dom, emulation, inspector, network, page and schema handlers to new generator. (Closed)
Patch Set: rebased atop of roll Created 4 years 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/emulation_handler.h
diff --git a/content/browser/devtools/protocol/emulation_handler.h b/content/browser/devtools/protocol/emulation_handler.h
index 8a98ce65c80e2be5374eb8cf55b843544b5b884e..b5ff16927cdc0afc258e447084395bf657a4c66c 100644
--- a/content/browser/devtools/protocol/emulation_handler.h
+++ b/content/browser/devtools/protocol/emulation_handler.h
@@ -6,7 +6,7 @@
#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
#include "base/macros.h"
-#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
+#include "content/browser/devtools/protocol/emulation.h"
#include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
namespace content {
@@ -14,58 +14,43 @@ namespace content {
class RenderFrameHostImpl;
class WebContentsImpl;
-namespace devtools {
+namespace protocol {
-namespace page { class PageHandler; }
-
-namespace emulation {
-
-class EmulationHandler {
+class EmulationHandler : public Emulation::Backend {
public:
- using Response = DevToolsProtocolClient::Response;
-
EmulationHandler();
- ~EmulationHandler();
+ ~EmulationHandler() override;
void SetRenderFrameHost(RenderFrameHostImpl* host);
- void SetClient(std::unique_ptr<Client> client) { }
- void Detached();
+ void Wire(UberDispatcher*);
+ Response Disable() override;
- Response SetGeolocationOverride(double* latitude,
- double* longitude,
- double* accuracy);
- Response ClearGeolocationOverride();
+ Response SetGeolocationOverride(Maybe<double> latitude,
+ Maybe<double> longitude,
+ Maybe<double> accuracy) override;
+ Response ClearGeolocationOverride() override;
Response SetTouchEmulationEnabled(bool enabled,
- const std::string* configuration);
+ Maybe<std::string> configuration) override;
- Response CanEmulate(bool* result);
+ Response CanEmulate(bool* result) override;
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,
- const int* screen_widget,
- const int* screen_height,
- const int* position_x,
- const int* position_y,
- const std::unique_ptr<base::DictionaryValue>& screen_orientation);
- Response ClearDeviceMetricsOverride();
-
- Response SetVisibleSize(int width, int height);
-
- Response ForceViewport(double x, double y, double scale);
- Response ResetViewport();
- Response ResetPageScaleFactor();
- Response SetPageScaleFactor(double page_scale_factor);
- Response SetScriptExecutionDisabled(bool disabled);
- Response SetEmulatedMedia(const std::string& media);
- Response SetCPUThrottlingRate(double rate);
- Response SetVirtualTimePolicy(const std::string& policy, const int* budget);
+ Maybe<double> scale,
+ Maybe<double> offset_x,
+ Maybe<double> offset_y,
+ Maybe<int> screen_widget,
+ Maybe<int> screen_height,
+ Maybe<int> position_x,
+ Maybe<int> position_y,
+ Maybe<Emulation::ScreenOrientation> screen_orientation) override;
+ Response ClearDeviceMetricsOverride() override;
+
+ Response SetVisibleSize(int width, int height) override;
private:
WebContentsImpl* GetWebContents();
@@ -83,8 +68,7 @@ class EmulationHandler {
DISALLOW_COPY_AND_ASSIGN(EmulationHandler);
};
-} // namespace emulation
-} // namespace devtools
+} // namespace protocol
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_EMULATION_HANDLER_H_
« no previous file with comments | « content/browser/devtools/protocol/dom_handler.cc ('k') | content/browser/devtools/protocol/emulation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698