| 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 host_->OnReadyToCommitFirstNavigation(); |
| 125 } |
| 126 |
| 121 void AppWindowContentsImpl::UpdateDraggableRegions( | 127 void AppWindowContentsImpl::UpdateDraggableRegions( |
| 122 const std::vector<DraggableRegion>& regions) { | 128 const std::vector<DraggableRegion>& regions) { |
| 123 host_->UpdateDraggableRegions(regions); | 129 host_->UpdateDraggableRegions(regions); |
| 124 } | 130 } |
| 125 | 131 |
| 126 void AppWindowContentsImpl::SuspendRenderFrameHost( | 132 void AppWindowContentsImpl::SuspendRenderFrameHost( |
| 127 content::RenderFrameHost* rfh) { | 133 content::RenderFrameHost* rfh) { |
| 128 DCHECK(rfh); | 134 DCHECK(rfh); |
| 129 // Don't bother blocking requests if the renderer side is already good to go. | 135 // Don't bother blocking requests if the renderer side is already good to go. |
| 130 if (is_window_ready_) | 136 if (is_window_ready_) |
| 131 return; | 137 return; |
| 132 is_blocking_requests_ = true; | 138 is_blocking_requests_ = true; |
| 133 // The ResourceDispatcherHost only accepts RenderViewHost child ids. | 139 // The ResourceDispatcherHost only accepts RenderViewHost child ids. |
| 134 // TODO(devlin): This will need to change for site isolation. | 140 // TODO(devlin): This will need to change for site isolation. |
| 135 content::BrowserThread::PostTask( | 141 content::BrowserThread::PostTask( |
| 136 content::BrowserThread::IO, FROM_HERE, | 142 content::BrowserThread::IO, FROM_HERE, |
| 137 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, | 143 base::Bind(&content::ResourceDispatcherHost::BlockRequestsForRoute, |
| 138 base::Unretained(content::ResourceDispatcherHost::Get()), | 144 base::Unretained(content::ResourceDispatcherHost::Get()), |
| 139 rfh->GetProcess()->GetID(), | 145 rfh->GetProcess()->GetID(), |
| 140 rfh->GetRenderViewHost()->GetRoutingID())); | 146 rfh->GetRenderViewHost()->GetRoutingID())); |
| 141 } | 147 } |
| 142 | 148 |
| 143 } // namespace extensions | 149 } // namespace extensions |
| OLD | NEW |