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

Unified Diff: extensions/browser/app_window/app_window_contents.cc

Issue 2929493003: Move handling of DraggableRegionsChanged notification from "view" to "frame". (Closed)
Patch Set: Also add main frame filtering to the browser-side. 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
Index: extensions/browser/app_window/app_window_contents.cc
diff --git a/extensions/browser/app_window/app_window_contents.cc b/extensions/browser/app_window/app_window_contents.cc
index 2478ddeba03723437966037bc5b854f3b7e9aeee..875d2cceb215847428927b4b90990a65d252272a 100644
--- a/extensions/browser/app_window/app_window_contents.cc
+++ b/extensions/browser/app_window/app_window_contents.cc
@@ -97,9 +97,11 @@ WindowController* AppWindowContentsImpl::GetWindowController() const {
return nullptr;
}
-bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) {
+bool AppWindowContentsImpl::OnMessageReceived(
+ const IPC::Message& message,
+ content::RenderFrameHost* sender) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(AppWindowContentsImpl, message)
+ IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(AppWindowContentsImpl, message, sender)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions,
UpdateDraggableRegions)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -114,8 +116,10 @@ void AppWindowContentsImpl::ReadyToCommitNavigation(
}
void AppWindowContentsImpl::UpdateDraggableRegions(
+ content::RenderFrameHost* sender,
const std::vector<DraggableRegion>& regions) {
- host_->UpdateDraggableRegions(regions);
+ if (!sender->GetParent()) // Only process events from the main frame.
+ host_->UpdateDraggableRegions(regions);
}
void AppWindowContentsImpl::SuspendRenderFrameHost(

Powered by Google App Engine
This is Rietveld 408576698