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

Side by Side Diff: extensions/browser/app_window/app_window_contents.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/app_window/app_window_contents.h" 5 #include "extensions/browser/app_window/app_window_contents.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 content::WebContents* AppWindowContentsImpl::GetWebContents() const { 92 content::WebContents* AppWindowContentsImpl::GetWebContents() const {
93 return web_contents_.get(); 93 return web_contents_.get();
94 } 94 }
95 95
96 WindowController* AppWindowContentsImpl::GetWindowController() const { 96 WindowController* AppWindowContentsImpl::GetWindowController() const {
97 return nullptr; 97 return nullptr;
98 } 98 }
99 99
100 bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) { 100 bool AppWindowContentsImpl::OnMessageReceived(
101 const IPC::Message& message,
102 content::RenderFrameHost* sender) {
101 bool handled = true; 103 bool handled = true;
102 IPC_BEGIN_MESSAGE_MAP(AppWindowContentsImpl, message) 104 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(AppWindowContentsImpl, message, sender)
103 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions, 105 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions,
104 UpdateDraggableRegions) 106 UpdateDraggableRegions)
105 IPC_MESSAGE_UNHANDLED(handled = false) 107 IPC_MESSAGE_UNHANDLED(handled = false)
106 IPC_END_MESSAGE_MAP() 108 IPC_END_MESSAGE_MAP()
107 return handled; 109 return handled;
108 } 110 }
109 111
110 void AppWindowContentsImpl::ReadyToCommitNavigation( 112 void AppWindowContentsImpl::ReadyToCommitNavigation(
111 content::NavigationHandle* handle) { 113 content::NavigationHandle* handle) {
112 if (!is_window_ready_) 114 if (!is_window_ready_)
113 host_->OnReadyToCommitFirstNavigation(); 115 host_->OnReadyToCommitFirstNavigation();
114 } 116 }
115 117
116 void AppWindowContentsImpl::UpdateDraggableRegions( 118 void AppWindowContentsImpl::UpdateDraggableRegions(
119 content::RenderFrameHost* sender,
117 const std::vector<DraggableRegion>& regions) { 120 const std::vector<DraggableRegion>& regions) {
118 host_->UpdateDraggableRegions(regions); 121 if (!sender->GetParent()) // Only process events from the main frame.
122 host_->UpdateDraggableRegions(regions);
119 } 123 }
120 124
121 void AppWindowContentsImpl::SuspendRenderFrameHost( 125 void AppWindowContentsImpl::SuspendRenderFrameHost(
122 content::RenderFrameHost* rfh) { 126 content::RenderFrameHost* rfh) {
123 DCHECK(rfh); 127 DCHECK(rfh);
124 // Don't bother blocking requests if the renderer side is already good to go. 128 // Don't bother blocking requests if the renderer side is already good to go.
125 if (is_window_ready_) 129 if (is_window_ready_)
126 return; 130 return;
127 is_blocking_requests_ = true; 131 is_blocking_requests_ = true;
128 rfh->BlockRequestsForFrame(); 132 rfh->BlockRequestsForFrame();
129 } 133 }
130 134
131 } // namespace extensions 135 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/app_window/app_window_contents.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698