| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 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" | |
| 8 | |
| 9 namespace devtools_bridge { | |
| 10 | |
| 11 namespace { | |
| 12 | |
| 13 class WebClientImpl : public WebClient, private content::WebContentsDelegate { | |
| 14 public: | |
| 15 WebClientImpl(content::BrowserContext* context, Delegate* delegate); | |
| 16 | |
| 17 private: | |
| 18 Delegate* const delegate_; | |
| 19 const scoped_ptr<content::WebContents> web_contents_; | |
| 20 }; | |
| 21 | |
| 22 WebClientImpl::WebClientImpl(content::BrowserContext* context, | |
| 23 Delegate* delegate) | |
| 24 : delegate_(delegate), | |
| 25 web_contents_(content::WebContents::Create( | |
| 26 content::WebContents::CreateParams(context))) { | |
| 27 web_contents_->SetDelegate(this); | |
| 28 } | |
| 29 | |
| 30 } // namespace | |
| 31 | |
| 32 scoped_ptr<WebClient> WebClient::CreateInstance( | |
| 33 content::BrowserContext* context, Delegate* delegate) { | |
| 34 return make_scoped_ptr(new WebClientImpl(context, delegate)); | |
| 35 } | |
| 36 | |
| 37 } // namespace devtools_bridge | |
| OLD | NEW |