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

Unified Diff: components/devtools_bridge/client/web_client.cc

Issue 736363002: Stub for web-base client for DevTools bridge and tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed presubmits Created 6 years, 1 month 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 | « components/devtools_bridge/client/web_client.h ('k') | components/devtools_bridge/test/android/client/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/devtools_bridge/client/web_client.cc
diff --git a/components/devtools_bridge/client/web_client.cc b/components/devtools_bridge/client/web_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d323db52e332d2e24d5640ec21331847ab42b112
--- /dev/null
+++ b/components/devtools_bridge/client/web_client.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 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 "components/devtools_bridge/client/web_client.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_delegate.h"
+
+namespace devtools_bridge {
+
+namespace {
+
+class WebClientImpl : public WebClient, private content::WebContentsDelegate {
+ public:
+ WebClientImpl(content::BrowserContext* context, Delegate* delegate);
+
+ private:
+ Delegate* const delegate_;
+ const scoped_ptr<content::WebContents> web_contents_;
+};
+
+WebClientImpl::WebClientImpl(content::BrowserContext* context,
+ Delegate* delegate)
+ : delegate_(delegate),
+ web_contents_(content::WebContents::Create(
+ content::WebContents::CreateParams(context))) {
+ web_contents_->SetDelegate(this);
+}
+
+} // namespace
+
+scoped_ptr<WebClient> WebClient::CreateInstance(
+ content::BrowserContext* context, Delegate* delegate) {
+ return make_scoped_ptr(new WebClientImpl(context, delegate));
+}
+
+} // namespace devtools_bridge
« no previous file with comments | « components/devtools_bridge/client/web_client.h ('k') | components/devtools_bridge/test/android/client/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698