Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: chromecast/browser/cast_content_window.cc

Issue 1478643002: Refactor media out of WebContentsImpl to MediaWebContentsObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix namespace for cast. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromecast/browser/cast_content_window.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/cast_content_window.h" 5 #include "chromecast/browser/cast_content_window.h"
6 6
7 #include "base/threading/thread_restrictions.h" 7 #include "base/threading/thread_restrictions.h"
8 #include "chromecast/base/metrics/cast_metrics_helper.h" 8 #include "chromecast/base/metrics/cast_metrics_helper.h"
9 #include "chromecast/browser/cast_browser_process.h" 9 #include "chromecast/browser/cast_browser_process.h"
10 #include "chromecast/media/base/video_plane_controller.h" 10 #include "chromecast/media/base/video_plane_controller.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 content::WebContents* web_contents = content::WebContents::Create( 115 content::WebContents* web_contents = content::WebContents::Create(
116 create_params); 116 create_params);
117 content::WebContentsObserver::Observe(web_contents); 117 content::WebContentsObserver::Observe(web_contents);
118 return make_scoped_ptr(web_contents); 118 return make_scoped_ptr(web_contents);
119 } 119 }
120 120
121 void CastContentWindow::DidFirstVisuallyNonEmptyPaint() { 121 void CastContentWindow::DidFirstVisuallyNonEmptyPaint() {
122 metrics::CastMetricsHelper::GetInstance()->LogTimeToFirstPaint(); 122 metrics::CastMetricsHelper::GetInstance()->LogTimeToFirstPaint();
123 } 123 }
124 124
125 void CastContentWindow::MediaPaused() { 125 void CastContentWindow::MediaStoppedPlaying(const MediaPlayerId& id) {
126 metrics::CastMetricsHelper::GetInstance()->LogMediaPause(); 126 metrics::CastMetricsHelper::GetInstance()->LogMediaPause();
127 } 127 }
128 128
129 void CastContentWindow::MediaStartedPlaying() { 129 void CastContentWindow::MediaStartedPlaying(const MediaPlayerId& id) {
130 metrics::CastMetricsHelper::GetInstance()->LogMediaPlay(); 130 metrics::CastMetricsHelper::GetInstance()->LogMediaPlay();
131 } 131 }
132 132
133 void CastContentWindow::RenderViewCreated( 133 void CastContentWindow::RenderViewCreated(
134 content::RenderViewHost* render_view_host) { 134 content::RenderViewHost* render_view_host) {
135 content::RenderWidgetHostView* view = 135 content::RenderWidgetHostView* view =
136 render_view_host->GetWidget()->GetView(); 136 render_view_host->GetWidget()->GetView();
137 if (view) 137 if (view)
138 view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT 138 view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT
139 : SK_ColorBLACK); 139 : SK_ColorBLACK);
140 } 140 }
141 141
142 } // namespace shell 142 } // namespace shell
143 } // namespace chromecast 143 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_content_window.h ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698