Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) { | 111 bool AppWindowContentsImpl::OnMessageReceived(const IPC::Message& message) { |
| 112 bool handled = true; | 112 bool handled = true; |
| 113 IPC_BEGIN_MESSAGE_MAP(AppWindowContentsImpl, message) | 113 IPC_BEGIN_MESSAGE_MAP(AppWindowContentsImpl, message) |
| 114 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions, | 114 IPC_MESSAGE_HANDLER(ExtensionHostMsg_UpdateDraggableRegions, |
| 115 UpdateDraggableRegions) | 115 UpdateDraggableRegions) |
| 116 IPC_MESSAGE_UNHANDLED(handled = false) | 116 IPC_MESSAGE_UNHANDLED(handled = false) |
| 117 IPC_END_MESSAGE_MAP() | 117 IPC_END_MESSAGE_MAP() |
| 118 return handled; | 118 return handled; |
| 119 } | 119 } |
| 120 | 120 |
| 121 void AppWindowContentsImpl::ReadyToCommitNavigation( | |
| 122 content::NavigationHandle* handle) { | |
| 123 if (is_window_ready_) | |
| 124 return; | |
| 125 host_->OnReadyToCommit(); | |
|
Devlin
2015/09/16 21:44:04
OnReadyToCommit() implies it might be called on *e
clamy
2015/09/16 22:19:39
Done.
| |
| 126 } | |
| 127 | |
| 121 void AppWindowContentsImpl::UpdateDraggableRegions( | 128 void AppWindowContentsImpl::UpdateDraggableRegions( |
| 122 const std::vector<DraggableRegion>& regions) { | 129 const std::vector<DraggableRegion>& regions) { |
| 123 host_->UpdateDraggableRegions(regions); | 130 host_->UpdateDraggableRegions(regions); |
| 124 } | 131 } |
| 125 | 132 |
| 126 void AppWindowContentsImpl::SuspendRenderFrameHost( | 133 void AppWindowContentsImpl::SuspendRenderFrameHost( |
| 127 content::RenderFrameHost* rfh) { | 134 content::RenderFrameHost* rfh) { |
| 128 DCHECK(rfh); | 135 DCHECK(rfh); |
| 129 // Don't bother blocking requests if the renderer side is already good to go. | 136 // Don't bother blocking requests if the renderer side is already good to go. |
| 130 if (is_window_ready_) | 137 if (is_window_ready_) |
| 131 return; | 138 return; |
| 132 is_blocking_requests_ = true; | 139 is_blocking_requests_ = true; |
| 133 // The ResourceDispatcherHost only accepts RenderViewHost child ids. | 140 // The ResourceDispatcherHost only accepts RenderViewHost child ids. |
| 134 // TODO(devlin): This will need to change for site isolation. | 141 // TODO(devlin): This will need to change for site isolation. |
| 135 content::BrowserThread::PostTask( | 142 content::BrowserThread::PostTask( |
| 136 content::BrowserThread::IO, FROM_HERE, | 143 content::BrowserThread::IO, FROM_HERE, |
| 137 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, | 144 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, |
| 138 base::Unretained(content::ResourceDispatcherHost::Get()), | 145 base::Unretained(content::ResourceDispatcherHost::Get()), |
| 139 rfh->GetProcess()->GetID(), | 146 rfh->GetProcess()->GetID(), |
| 140 rfh->GetRenderViewHost()->GetRoutingID())); | 147 rfh->GetRenderViewHost()->GetRoutingID())); |
| 141 } | 148 } |
| 142 | 149 |
| 143 } // namespace extensions | 150 } // namespace extensions |
| OLD | NEW |