forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcast_web_view_factory.cc
36 lines (28 loc) · 1.08 KB
/
cast_web_view_factory.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/browser/cast_web_view_factory.h"
#include "chromecast/browser/cast_web_view_default.h"
#include "chromecast/chromecast_buildflags.h"
namespace chromecast {
CastWebViewFactory::CastWebViewFactory(content::BrowserContext* browser_context)
: browser_context_(browser_context) {
DCHECK(browser_context_);
}
CastWebViewFactory::~CastWebViewFactory() = default;
void CastWebViewFactory::OnPageDestroyed(CastWebView* web_view) {
web_view->RemoveObserver(this);
}
std::unique_ptr<CastWebView> CastWebViewFactory::CreateWebView(
const CastWebView::CreateParams& params,
CastWebService* web_service,
const GURL& initial_url) {
std::unique_ptr<CastWebView> webview;
webview = std::make_unique<CastWebViewDefault>(params, web_service,
browser_context_);
if (webview) {
webview->AddObserver(this);
}
return webview;
}
} // namespace chromecast