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

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

Issue 2817593004: [DevTools] Move eye dropper functionality from protocol to embedder (Closed)
Patch Set: rebased Created 3 years, 8 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 860d28de604700555457909d3caa3c7be79b0864..def6fe326213508213832bbc40f22c43e8424a6f 100644
--- a/content/browser/devtools/protocol/page_handler.cc
+++ b/content/browser/devtools/protocol/page_handler.cc
@@ -22,7 +22,6 @@
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/devtools/devtools_session.h"
#include "content/browser/devtools/page_navigation_throttle.h"
-#include "content/browser/devtools/protocol/color_picker.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -101,8 +100,6 @@ PageHandler::PageHandler()
session_id_(0),
frame_counter_(0),
frames_in_flight_(0),
- color_picker_(new ColorPicker(
- base::Bind(&PageHandler::OnColorPicked, base::Unretained(this)))),
navigation_throttle_enabled_(false),
next_navigation_id_(0),
host_(nullptr),
@@ -132,7 +129,6 @@ void PageHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
host_ = host;
widget_host = host_ ? host_->GetRenderWidgetHost() : nullptr;
- color_picker_->SetRenderWidgetHost(widget_host);
if (widget_host) {
registrar_.Add(
@@ -154,7 +150,6 @@ void PageHandler::OnSwapCompositorFrame(
if (screencast_enabled_)
InnerSwapCompositorFrame();
- color_picker_->OnSwapCompositorFrame();
}
void PageHandler::OnSynchronousSwapCompositorFrame(
@@ -171,7 +166,6 @@ void PageHandler::OnSynchronousSwapCompositorFrame(
if (screencast_enabled_)
InnerSwapCompositorFrame();
- color_picker_->OnSwapCompositorFrame();
}
void PageHandler::Observe(int type,
@@ -207,7 +201,6 @@ Response PageHandler::Disable() {
enabled_ = false;
screencast_enabled_ = false;
SetControlNavigations(false);
- color_picker_->SetEnabled(false);
return Response::FallThrough();
}
@@ -377,14 +370,6 @@ Response PageHandler::HandleJavaScriptDialog(bool accept,
return Response::Error("Could not handle JavaScript dialog");
}
-Response PageHandler::SetColorPickerEnabled(bool enabled) {
- if (!host_)
- return Response::InternalError();
-
- color_picker_->SetEnabled(enabled);
- return Response::OK();
-}
-
Response PageHandler::RequestAppBanner() {
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
@@ -587,11 +572,6 @@ void PageHandler::ScreenshotCaptured(
callback->sendSuccess(EncodeImage(image, format, quality));
}
-void PageHandler::OnColorPicked(int r, int g, int b, int a) {
- frontend_->ColorPicked(
- DOM::RGBA::Create().SetR(r).SetG(g).SetB(b).SetA(a).Build());
-}
-
Response PageHandler::StopLoading() {
WebContentsImpl* web_contents = GetWebContents();
if (!web_contents)
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | third_party/WebKit/Source/core/inspector/browser_protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698