| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 rfh->Send(new ExtensionMsg_MessageInvoke(rfh->GetRoutingID(), | 75 rfh->Send(new ExtensionMsg_MessageInvoke(rfh->GetRoutingID(), |
| 76 host_->extension_id(), "app.window", | 76 host_->extension_id(), "app.window", |
| 77 "updateAppWindowProperties", args)); | 77 "updateAppWindowProperties", args)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void AppWindowContentsImpl::NativeWindowClosed() { | 80 void AppWindowContentsImpl::NativeWindowClosed() { |
| 81 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 81 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
| 82 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); | 82 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void AppWindowContentsImpl::DispatchWindowShownForTests() const { | |
| 86 base::ListValue args; | |
| 87 content::RenderFrameHost* rfh = web_contents_->GetMainFrame(); | |
| 88 rfh->Send(new ExtensionMsg_MessageInvoke(rfh->GetRoutingID(), | |
| 89 host_->extension_id(), "app.window", | |
| 90 "appWindowShownForTests", args)); | |
| 91 } | |
| 92 | |
| 93 void AppWindowContentsImpl::OnWindowReady() { | 85 void AppWindowContentsImpl::OnWindowReady() { |
| 94 is_window_ready_ = true; | 86 is_window_ready_ = true; |
| 95 if (is_blocking_requests_) { | 87 if (is_blocking_requests_) { |
| 96 is_blocking_requests_ = false; | 88 is_blocking_requests_ = false; |
| 97 content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI( | 89 content::ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI( |
| 98 web_contents_->GetMainFrame()); | 90 web_contents_->GetMainFrame()); |
| 99 } | 91 } |
| 100 } | 92 } |
| 101 | 93 |
| 102 content::WebContents* AppWindowContentsImpl::GetWebContents() const { | 94 content::WebContents* AppWindowContentsImpl::GetWebContents() const { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 132 content::RenderFrameHost* rfh) { | 124 content::RenderFrameHost* rfh) { |
| 133 DCHECK(rfh); | 125 DCHECK(rfh); |
| 134 // Don't bother blocking requests if the renderer side is already good to go. | 126 // Don't bother blocking requests if the renderer side is already good to go. |
| 135 if (is_window_ready_) | 127 if (is_window_ready_) |
| 136 return; | 128 return; |
| 137 is_blocking_requests_ = true; | 129 is_blocking_requests_ = true; |
| 138 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); | 130 content::ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); |
| 139 } | 131 } |
| 140 | 132 |
| 141 } // namespace extensions | 133 } // namespace extensions |
| OLD | NEW |