| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/cast_web_view.h" | 5 #include "chromecast/browser/cast_web_view.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 void CastWebView::ActivateContents(content::WebContents* contents) { | 146 void CastWebView::ActivateContents(content::WebContents* contents) { |
| 147 DCHECK_EQ(contents, web_contents_.get()); | 147 DCHECK_EQ(contents, web_contents_.get()); |
| 148 contents->GetRenderViewHost()->GetWidget()->Focus(); | 148 contents->GetRenderViewHost()->GetWidget()->Focus(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 #if defined(OS_ANDROID) | 151 #if defined(OS_ANDROID) |
| 152 base::android::ScopedJavaLocalRef<jobject> | 152 base::android::ScopedJavaLocalRef<jobject> |
| 153 CastWebView::GetContentVideoViewEmbedder() { | 153 CastWebView::GetContentVideoViewEmbedder() { |
| 154 DCHECK(web_contents_); | 154 DCHECK(web_contents_); |
| 155 auto activity = shell::CastWebContentsActivity::Get(web_contents_.get()); | 155 auto* activity = shell::CastWebContentsActivity::Get(web_contents_.get()); |
| 156 return activity->GetContentVideoViewEmbedder(); | 156 return activity->GetContentVideoViewEmbedder(); |
| 157 } | 157 } |
| 158 #endif // defined(OS_ANDROID) | 158 #endif // defined(OS_ANDROID) |
| 159 | 159 |
| 160 void CastWebView::RenderProcessGone(base::TerminationStatus status) { | 160 void CastWebView::RenderProcessGone(base::TerminationStatus status) { |
| 161 LOG(INFO) << "APP_ERROR_CHILD_PROCESS_CRASHED"; | 161 LOG(INFO) << "APP_ERROR_CHILD_PROCESS_CRASHED"; |
| 162 delegate_->OnPageStopped(net::ERR_UNEXPECTED); | 162 delegate_->OnPageStopped(net::ERR_UNEXPECTED); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void CastWebView::RenderViewCreated(content::RenderViewHost* render_view_host) { | 165 void CastWebView::RenderViewCreated(content::RenderViewHost* render_view_host) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 const MediaPlayerId& id) { | 249 const MediaPlayerId& id) { |
| 250 metrics::CastMetricsHelper::GetInstance()->LogMediaPlay(); | 250 metrics::CastMetricsHelper::GetInstance()->LogMediaPlay(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void CastWebView::MediaStoppedPlaying(const MediaPlayerInfo& media_info, | 253 void CastWebView::MediaStoppedPlaying(const MediaPlayerInfo& media_info, |
| 254 const MediaPlayerId& id) { | 254 const MediaPlayerId& id) { |
| 255 metrics::CastMetricsHelper::GetInstance()->LogMediaPause(); | 255 metrics::CastMetricsHelper::GetInstance()->LogMediaPause(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace chromecast | 258 } // namespace chromecast |
| OLD | NEW |