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 |