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

Unified Diff: chrome/browser/browser.cc

Issue 50009: Allow different types of devtools client (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « no previous file | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 12273)
+++ chrome/browser/browser.cc (working copy)
@@ -16,6 +16,7 @@
#include "chrome/browser/browser_window.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/debugger/devtools_manager.h"
+#include "chrome/browser/debugger/devtools_window.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/net/url_fixer_upper.h"
@@ -941,11 +942,19 @@
#ifndef CHROME_DEBUGGER_DISABLED
UserMetrics::RecordAction(L"Debugger", profile_);
TabContents* current_tab = GetSelectedTabContents();
- if (current_tab->AsWebContents()) {
+ WebContents* wc = current_tab->AsWebContents();
+ if (wc) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableOutOfProcessDevTools)) {
- WebContents* wc = current_tab->AsWebContents();
- g_browser_process->devtools_manager()->ShowDevToolsForWebContents(wc);
+ DevToolsManager* manager = g_browser_process->devtools_manager();
+ DevToolsClientHost* host = manager->GetDevToolsClientHostFor(*wc);
+ if (!host) {
+ host = DevToolsWindow::Create();
+ manager->RegisterDevToolsClientHostFor(*wc, host);
+ }
+ DevToolsWindow* window = host->AsDevToolsWindow();
+ if (window)
+ window->Show();
} else {
// Only one debugger instance can exist at a time right now.
// TODO(erikkay): need an alert, dialog, something
« no previous file with comments | « no previous file | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698