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

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

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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/page_handler.cc
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc
index 8bb70eeba7734e4f412e71aa2f644a1e2a65bbf8..c2931a77843ed7225e99250a9601bba0656fefdd 100644
--- a/content/browser/devtools/protocol/page_handler.cc
+++ b/content/browser/devtools/protocol/page_handler.cc
@@ -121,6 +121,7 @@ PageHandler::PageHandler()
&PageHandler::OnColorPicked, base::Unretained(this)))),
frame_recorder_(new FrameRecorder()),
host_(nullptr),
+ screencast_listener_(nullptr),
weak_factory_(this) {
}
@@ -177,6 +178,10 @@ void PageHandler::DidDetachInterstitialPage() {
client_->InterstitialHidden(InterstitialHiddenParams::Create());
}
+void PageHandler::SetScreencastListener(ScreencastListener* listener) {
+ screencast_listener_ = listener;
+}
+
Response PageHandler::Enable() {
enabled_ = true;
return Response::FallThrough();
@@ -190,6 +195,8 @@ Response PageHandler::Disable() {
UpdateTouchEventEmulationState();
UpdateDeviceEmulationState();
color_picker_->SetEnabled(false);
+ if (screencast_listener_)
+ screencast_listener_->ScreencastEnabledChanged();
return Response::FallThrough();
}
@@ -439,12 +446,16 @@ Response PageHandler::StartScreencast(const std::string* format,
else
host_->Send(new ViewMsg_ForceRedraw(host_->GetRoutingID(), 0));
}
+ if (screencast_listener_)
+ screencast_listener_->ScreencastEnabledChanged();
return Response::FallThrough();
}
Response PageHandler::StopScreencast() {
screencast_enabled_ = false;
UpdateTouchEventEmulationState();
+ if (screencast_listener_)
+ screencast_listener_->ScreencastEnabledChanged();
return Response::FallThrough();
}
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | content/browser/devtools/render_frame_devtools_agent_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698