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

Unified Diff: extensions/renderer/extension_frame_helper.cc

Issue 2929493003: Move handling of DraggableRegionsChanged notification from "view" to "frame". (Closed)
Patch Set: Removed an unnecessary comment as suggested by dcheng@. 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..b409b1c3c46244b0c3fa0c2b2c3f4095090ca0a0 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,19 @@ void ExtensionFrameHelper::OnDestruct() {
delete this;
}
+void ExtensionFrameHelper::DraggableRegionsChanged() {
+ blink::WebVector<blink::WebDraggableRegion> webregions =
+ render_frame()->GetWebFrame()->GetDocument().DraggableRegions();
+ std::vector<DraggableRegion> regions;
+ for (size_t i = 0; i < webregions.size(); ++i) {
+ DraggableRegion region;
+ render_frame()->GetRenderView()->ConvertViewportToWindowViaWidget(
alexmos 2017/06/08 21:19:00 Is this going to work for a swapped-out RenderView
Łukasz Anforowicz 2017/06/08 22:27:13 Thanks for catching this. I guess one option woul
kenrb 2017/06/09 15:43:25 As far as I know, using ConvertViewportToWindowVia
+ &webregions[i].bounds);
+ region.bounds = webregions[i].bounds;
+ region.draggable = webregions[i].draggable;
+ regions.push_back(region);
+ }
+ 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