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

Unified Diff: chromecast/browser/cast_content_window_linux.cc

Issue 2626863006: [Chromecast] Add CastWebContents (Closed)
Patch Set: [Chromecast] Add CastWebContents Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/browser/cast_content_window_linux.h ('k') | chromecast/browser/cast_web_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/browser/cast_content_window_linux.cc
diff --git a/chromecast/browser/cast_content_window_linux.cc b/chromecast/browser/cast_content_window_linux.cc
index eb654d5164bf25495c2202894c5a2736f6488ca0..c3bf970d2d5920db03e435cb97aaf3885b414eed 100644
--- a/chromecast/browser/cast_content_window_linux.cc
+++ b/chromecast/browser/cast_content_window_linux.cc
@@ -6,13 +6,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "chromecast/base/metrics/cast_metrics_helper.h"
-#include "chromecast/base/version.h"
-#include "chromecast/browser/cast_browser_process.h"
#include "chromecast/graphics/cast_window_manager.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_widget_host.h"
-#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "ipc/ipc_message.h"
#include "ui/display/display.h"
@@ -20,7 +14,7 @@
#if defined(USE_AURA)
#include "ui/aura/window.h"
-#endif
+#endif // defined(USE_AURA)
namespace chromecast {
namespace shell {
@@ -40,36 +34,6 @@ void CastContentWindowLinux::SetTransparent() {
transparent_ = true;
}
-std::unique_ptr<content::WebContents> CastContentWindowLinux::CreateWebContents(
- content::BrowserContext* browser_context,
- scoped_refptr<content::SiteInstance> site_instance) {
- CHECK(display::Screen::GetScreen());
- gfx::Size display_size =
- display::Screen::GetScreen()->GetPrimaryDisplay().size();
-
- content::WebContents::CreateParams create_params(browser_context, NULL);
- create_params.routing_id = MSG_ROUTING_NONE;
- create_params.initial_size = display_size;
- create_params.site_instance = site_instance;
- content::WebContents* web_contents =
- content::WebContents::Create(create_params);
-
- content::WebContentsObserver::Observe(web_contents);
- return base::WrapUnique(web_contents);
-}
-
-void CastContentWindowLinux::DidStartNavigation(
- content::NavigationHandle* navigation_handle) {
-#if defined(USE_AURA)
- // Resize window
- gfx::Size display_size =
- display::Screen::GetScreen()->GetPrimaryDisplay().size();
- aura::Window* content_window = web_contents()->GetNativeView();
- content_window->SetBounds(
- gfx::Rect(display_size.width(), display_size.height()));
-#endif
-}
-
void CastContentWindowLinux::ShowWebContents(
content::WebContents* web_contents,
CastWindowManager* window_manager) {
@@ -80,31 +44,5 @@ void CastContentWindowLinux::ShowWebContents(
window->Show();
}
-void CastContentWindowLinux::DidFirstVisuallyNonEmptyPaint() {
- metrics::CastMetricsHelper::GetInstance()->LogTimeToFirstPaint();
-}
-
-void CastContentWindowLinux::MediaStartedPlaying(
- const MediaPlayerInfo& media_info,
- const MediaPlayerId& id) {
- metrics::CastMetricsHelper::GetInstance()->LogMediaPlay();
-}
-
-void CastContentWindowLinux::MediaStoppedPlaying(
- const MediaPlayerInfo& media_info,
- const MediaPlayerId& id) {
- metrics::CastMetricsHelper::GetInstance()->LogMediaPause();
-}
-
-void CastContentWindowLinux::RenderViewCreated(
- content::RenderViewHost* render_view_host) {
- content::RenderWidgetHostView* view =
- render_view_host->GetWidget()->GetView();
- if (view) {
- view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT
- : SK_ColorBLACK);
- }
-}
-
} // namespace shell
} // namespace chromecast
« no previous file with comments | « chromecast/browser/cast_content_window_linux.h ('k') | chromecast/browser/cast_web_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698