OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/android/cast_window_android.h" | 5 #include "chromecast/browser/android/cast_window_android.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "chromecast/browser/android/cast_window_manager.h" | 8 #include "chromecast/browser/android/cast_window_manager.h" |
9 #include "chromecast/browser/cast_content_window.h" | 9 #include "chromecast/browser/cast_content_window.h" |
10 #include "content/public/browser/devtools_agent_host.h" | 10 #include "content/public/browser/devtools_agent_host.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); | 79 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); |
80 } | 80 } |
81 | 81 |
82 CastWindowAndroid::~CastWindowAndroid() { | 82 CastWindowAndroid::~CastWindowAndroid() { |
83 } | 83 } |
84 | 84 |
85 void CastWindowAndroid::Close() { | 85 void CastWindowAndroid::Close() { |
86 // Close page first, which fires the window.unload event. The WebContents | 86 // Close page first, which fires the window.unload event. The WebContents |
87 // itself will be destroyed after browser-process has received renderer | 87 // itself will be destroyed after browser-process has received renderer |
88 // notification that the page is closed. | 88 // notification that the page is closed. |
89 web_contents_->GetRenderViewHost()->ClosePage(); | 89 web_contents_->ClosePage(); |
90 } | 90 } |
91 | 91 |
92 void CastWindowAndroid::Destroy() { | 92 void CastWindowAndroid::Destroy() { |
93 // Note: if multiple windows becomes supported, this may close other devtools | 93 // Note: if multiple windows becomes supported, this may close other devtools |
94 // sessions. | 94 // sessions. |
95 content::DevToolsAgentHost::DetachAllClients(); | 95 content::DevToolsAgentHost::DetachAllClients(); |
96 CloseCastWindowView(window_java_.obj()); | 96 CloseCastWindowView(window_java_.obj()); |
97 delete this; | 97 delete this; |
98 } | 98 } |
99 | 99 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 contents->GetRenderViewHost()->Blur(); | 153 contents->GetRenderViewHost()->Blur(); |
154 } | 154 } |
155 | 155 |
156 void CastWindowAndroid::RenderProcessGone(base::TerminationStatus status) { | 156 void CastWindowAndroid::RenderProcessGone(base::TerminationStatus status) { |
157 LOG(ERROR) << "Render process gone: status=" << status; | 157 LOG(ERROR) << "Render process gone: status=" << status; |
158 Destroy(); | 158 Destroy(); |
159 } | 159 } |
160 | 160 |
161 } // namespace shell | 161 } // namespace shell |
162 } // namespace chromecast | 162 } // namespace chromecast |
OLD | NEW |