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
3 // found in the LICENSE file.
5 #include "components/devtools_bridge/client/web_client.h"
6 #include "content/public/browser/web_contents.h"
7 #include "content/public/browser/web_contents_delegate.h"
9 namespace devtools_bridge
{
13 class WebClientImpl
: public WebClient
, private content::WebContentsDelegate
{
15 WebClientImpl(content::BrowserContext
* context
, Delegate
* delegate
);
18 Delegate
* const delegate_
;
19 const scoped_ptr
<content::WebContents
> web_contents_
;
22 WebClientImpl::WebClientImpl(content::BrowserContext
* context
,
24 : delegate_(delegate
),
25 web_contents_(content::WebContents::Create(
26 content::WebContents::CreateParams(context
))) {
27 web_contents_
->SetDelegate(this);
32 scoped_ptr
<WebClient
> WebClient::CreateInstance(
33 content::BrowserContext
* context
, Delegate
* delegate
) {
34 return make_scoped_ptr(new WebClientImpl(context
, delegate
));
37 } // namespace devtools_bridge