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

Unified Diff: content/shell/browser/shell_devtools_manager_delegate.cc

Issue 1099243004: [DevTools] Migrate android to devtools_discovery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 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
« no previous file with comments | « components/devtools_discovery/devtools_discovery_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_devtools_manager_delegate.cc
diff --git a/content/shell/browser/shell_devtools_manager_delegate.cc b/content/shell/browser/shell_devtools_manager_delegate.cc
index 5384e392d4b52e6ba182b86a0b05c0e4980c7abe..cda44f8c8d824f420762a7c476f591d6cd712fe7 100644
--- a/content/shell/browser/shell_devtools_manager_delegate.cc
+++ b/content/shell/browser/shell_devtools_manager_delegate.cc
@@ -132,6 +132,16 @@ CreateSocketFactory() {
#endif
}
+scoped_ptr<devtools_discovery::DevToolsTargetDescriptor>
+CreateNewShellTarget(BrowserContext* browser_context, const GURL& url) {
+ Shell* shell = Shell::CreateNewWindow(browser_context,
+ url,
+ nullptr,
+ gfx::Size());
+ return make_scoped_ptr(new devtools_discovery::BasicTargetDescriptor(
+ DevToolsAgentHost::GetOrCreateFor(shell->web_contents())));
+}
+
// ShellDevToolsDelegate ----------------------------------------------------
class ShellDevToolsDelegate :
@@ -152,9 +162,15 @@ class ShellDevToolsDelegate :
ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context)
: browser_context_(browser_context) {
+ devtools_discovery::DevToolsDiscoveryManager::GetInstance()->
+ SetCreateCallback(base::Bind(&CreateNewShellTarget,
+ base::Unretained(browser_context)));
}
ShellDevToolsDelegate::~ShellDevToolsDelegate() {
+ devtools_discovery::DevToolsDiscoveryManager::GetInstance()->
+ SetCreateCallback(
+ devtools_discovery::DevToolsDiscoveryManager::CreateCallback());
}
std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
@@ -215,13 +231,9 @@ std::string ShellDevToolsManagerDelegate::GetPageThumbnailData(
scoped_ptr<DevToolsTarget>
ShellDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
- Shell* shell = Shell::CreateNewWindow(browser_context_,
- url,
- NULL,
- gfx::Size());
- return scoped_ptr<DevToolsTarget>(
- new devtools_discovery::BasicTargetDescriptor(
- DevToolsAgentHost::GetOrCreateFor(shell->web_contents())));
+ devtools_discovery::DevToolsDiscoveryManager* discovery_manager =
+ devtools_discovery::DevToolsDiscoveryManager::GetInstance();
+ return discovery_manager->CreateNew(url);
}
void ShellDevToolsManagerDelegate::EnumerateTargets(TargetCallback callback) {
« no previous file with comments | « components/devtools_discovery/devtools_discovery_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698