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

Unified Diff: extensions/renderer/extension_frame_helper.cc

Issue 2929493003: Move handling of DraggableRegionsChanged notification from "view" to "frame". (Closed)
Patch Set: Addressed CR feedback from rdevlin.cronin@. Created 3 years, 6 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
« no previous file with comments | « extensions/renderer/extension_frame_helper.h ('k') | extensions/renderer/extension_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/extension_frame_helper.cc
diff --git a/extensions/renderer/extension_frame_helper.cc b/extensions/renderer/extension_frame_helper.cc
index da47e687f5662c0d8eefb6830a860edf971c2689..a7da93efbf4a7709d95cc57a0ff55dbfdadb53fb 100644
--- a/extensions/renderer/extension_frame_helper.cc
+++ b/extensions/renderer/extension_frame_helper.cc
@@ -8,6 +8,7 @@
#include "base/strings/string_util.h"
#include "base/timer/elapsed_timer.h"
#include "content/public/renderer/render_frame.h"
+#include "content/public/renderer/render_view.h"
#include "extensions/common/api/messaging/message.h"
#include "extensions/common/api/messaging/port_id.h"
#include "extensions/common/constants.h"
@@ -335,4 +336,23 @@ void ExtensionFrameHelper::OnDestruct() {
delete this;
}
+void ExtensionFrameHelper::DraggableRegionsChanged() {
+ if (!render_frame()->IsMainFrame())
+ return;
+
+ blink::WebVector<blink::WebDraggableRegion> webregions =
+ render_frame()->GetWebFrame()->GetDocument().DraggableRegions();
+ std::vector<DraggableRegion> regions;
+ for (blink::WebDraggableRegion& webregion : webregions) {
+ render_frame()->GetRenderView()->ConvertViewportToWindowViaWidget(
+ &webregion.bounds);
+
+ regions.push_back(DraggableRegion());
+ DraggableRegion& region = regions.back();
+ region.bounds = webregion.bounds;
+ region.draggable = webregion.draggable;
+ }
+ Send(new ExtensionHostMsg_UpdateDraggableRegions(routing_id(), regions));
+}
+
} // namespace extensions
« no previous file with comments | « extensions/renderer/extension_frame_helper.h ('k') | extensions/renderer/extension_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698