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

Unified Diff: android_webview/browser/aw_dev_tools_discovery_provider.cc

Issue 2300703005: DevTools: merge devtools_http_handler into content - it is used in all the embedders anyways. (Closed)
Patch Set: for_landing! Created 4 years, 3 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
Index: android_webview/browser/aw_dev_tools_discovery_provider.cc
diff --git a/android_webview/browser/aw_dev_tools_discovery_provider.cc b/android_webview/browser/aw_dev_tools_discovery_provider.cc
deleted file mode 100644
index d29be3f856cbd4ec5673e92a3beb475e3819830d..0000000000000000000000000000000000000000
--- a/android_webview/browser/aw_dev_tools_discovery_provider.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 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 "android_webview/browser/aw_dev_tools_discovery_provider.h"
-
-#include "android_webview/browser/browser_view_renderer.h"
-#include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
-#include "content/public/browser/devtools_agent_host.h"
-#include "content/public/browser/web_contents.h"
-
-using content::DevToolsAgentHost;
-using content::WebContents;
-
-namespace {
-
-std::string GetViewDescription(WebContents* web_contents) {
- android_webview::BrowserViewRenderer* bvr =
- android_webview::BrowserViewRenderer::FromWebContents(web_contents);
- if (!bvr) return "";
- base::DictionaryValue description;
- description.SetBoolean("attached", bvr->attached_to_window());
- description.SetBoolean("visible", bvr->IsVisible());
- gfx::Rect screen_rect = bvr->GetScreenRect();
- description.SetInteger("screenX", screen_rect.x());
- description.SetInteger("screenY", screen_rect.y());
- description.SetBoolean("empty", screen_rect.size().IsEmpty());
- if (!screen_rect.size().IsEmpty()) {
- description.SetInteger("width", screen_rect.width());
- description.SetInteger("height", screen_rect.height());
- }
- std::string json;
- base::JSONWriter::Write(description, &json);
- return json;
-}
-
-content::DevToolsAgentHost::List GetDescriptors() {
- DevToolsAgentHost::List agent_hosts = DevToolsAgentHost::GetOrCreateAll();
- for (auto& agent_host : agent_hosts) {
- agent_host->SetDescriptionOverride(
- GetViewDescription(agent_host->GetWebContents()));
- }
- return agent_hosts;
-}
-
-} // namespace
-
-namespace android_webview {
-
-// static
-void AwDevToolsDiscoveryProvider::Install() {
- content::DevToolsAgentHost::AddDiscoveryProvider(base::Bind(&GetDescriptors));
-}
-
-AwDevToolsDiscoveryProvider::AwDevToolsDiscoveryProvider() {
-}
-
-AwDevToolsDiscoveryProvider::~AwDevToolsDiscoveryProvider() {
-}
-
-} // namespace android_webview
« no previous file with comments | « android_webview/browser/aw_dev_tools_discovery_provider.h ('k') | android_webview/browser/aw_devtools_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698