Commit 80d3f50e authored by apavlov@chromium.org's avatar apavlov@chromium.org

Revert "Make F12 close an undocked DevTools window rather than open another...

Revert "Make F12 close an undocked DevTools window rather than open another DevTools window for this one."
We decided to revert the change, since it breaks user experience a lot of clients are used to.

This reverts commit 30f6403d.

BUG=139581
TBR=pfeldman@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10825217

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150301 0039d316-1c4b-4281-b951-d872f2087c98
parent 2be867b9
...@@ -103,7 +103,15 @@ TabContents* DevToolsWindow::GetDevToolsContents(WebContents* inspected_tab) { ...@@ -103,7 +103,15 @@ TabContents* DevToolsWindow::GetDevToolsContents(WebContents* inspected_tab) {
// static // static
bool DevToolsWindow::IsDevToolsWindow(RenderViewHost* window_rvh) { bool DevToolsWindow::IsDevToolsWindow(RenderViewHost* window_rvh) {
return AsDevToolsWindow(window_rvh) != NULL; if (g_instances == NULL)
return false;
DevToolsWindowList& instances = g_instances.Get();
for (DevToolsWindowList::iterator it = instances.begin();
it != instances.end(); ++it) {
if ((*it)->tab_contents_->web_contents()->GetRenderViewHost() == window_rvh)
return true;
}
return false;
} }
// static // static
...@@ -608,14 +616,6 @@ DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow( ...@@ -608,14 +616,6 @@ DevToolsWindow* DevToolsWindow::ToggleDevToolsWindow(
RenderViewHost* inspected_rvh, RenderViewHost* inspected_rvh,
bool force_open, bool force_open,
DevToolsToggleAction action) { DevToolsToggleAction action) {
if (!force_open) {
DevToolsWindow* currentDevToolsWindow = AsDevToolsWindow(inspected_rvh);
if (currentDevToolsWindow) {
chrome::CloseAllTabs(currentDevToolsWindow->browser());
return currentDevToolsWindow;
}
}
DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost(
inspected_rvh); inspected_rvh);
DevToolsManager* manager = DevToolsManager::GetInstance(); DevToolsManager* manager = DevToolsManager::GetInstance();
...@@ -663,19 +663,6 @@ DevToolsWindow* DevToolsWindow::AsDevToolsWindow( ...@@ -663,19 +663,6 @@ DevToolsWindow* DevToolsWindow::AsDevToolsWindow(
return NULL; return NULL;
} }
// static
DevToolsWindow* DevToolsWindow::AsDevToolsWindow(RenderViewHost* rvh) {
if (g_instances == NULL)
return NULL;
DevToolsWindowList& instances = g_instances.Get();
for (DevToolsWindowList::iterator it = instances.begin();
it != instances.end(); ++it) {
if ((*it)->tab_contents_->web_contents()->GetRenderViewHost() == rvh)
return *it;
}
return NULL;
}
void DevToolsWindow::ActivateWindow() { void DevToolsWindow::ActivateWindow() {
if (!docked_) { if (!docked_) {
if (!browser_->window()->IsActive()) { if (!browser_->window()->IsActive()) {
......
...@@ -132,7 +132,6 @@ class DevToolsWindow : private content::NotificationObserver, ...@@ -132,7 +132,6 @@ class DevToolsWindow : private content::NotificationObserver,
bool force_open, bool force_open,
DevToolsToggleAction action); DevToolsToggleAction action);
static DevToolsWindow* AsDevToolsWindow(content::DevToolsClientHost*); static DevToolsWindow* AsDevToolsWindow(content::DevToolsClientHost*);
static DevToolsWindow* AsDevToolsWindow(content::RenderViewHost*);
// content::DevToolsClientHandlerDelegate overrides. // content::DevToolsClientHandlerDelegate overrides.
virtual void ActivateWindow() OVERRIDE; virtual void ActivateWindow() OVERRIDE;
......
...@@ -730,8 +730,7 @@ void RenderViewContextMenu::AppendDeveloperItems() { ...@@ -730,8 +730,7 @@ void RenderViewContextMenu::AppendDeveloperItems() {
bool show_developer_items = !IsDevToolsURL(params_.page_url); bool show_developer_items = !IsDevToolsURL(params_.page_url);
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDebugDevToolsFrontend) || if (command_line.HasSwitch(switches::kDebugDevToolsFrontend))
command_line.HasSwitch(switches::kDebugDevTools))
show_developer_items = true; show_developer_items = true;
#if defined(DEBUG_DEVTOOLS) #if defined(DEBUG_DEVTOOLS)
......
...@@ -220,10 +220,6 @@ const char kCrashOnHangThreads[] = "crash-on-hang-threads"; ...@@ -220,10 +220,6 @@ const char kCrashOnHangThreads[] = "crash-on-hang-threads";
// other threads are not responsive. // other threads are not responsive.
const char kCrashOnLive[] = "crash-on-live"; const char kCrashOnLive[] = "crash-on-live";
// Enables recursive devtools frontend debugging by enforcing the
// "Inspect Element" context menu item in devtools windows.
const char kDebugDevTools[] = "debug-devtools";
// Path to the inspector files on disk (allows reloading of devtool files // Path to the inspector files on disk (allows reloading of devtool files
// without having to restart the browser). // without having to restart the browser).
const char kDebugDevToolsFrontend[] = "debug-devtools-frontend"; const char kDebugDevToolsFrontend[] = "debug-devtools-frontend";
......
...@@ -70,7 +70,6 @@ extern const char kCountry[]; ...@@ -70,7 +70,6 @@ extern const char kCountry[];
extern const char kCrashOnHangSeconds[]; extern const char kCrashOnHangSeconds[];
extern const char kCrashOnHangThreads[]; extern const char kCrashOnHangThreads[];
extern const char kCrashOnLive[]; extern const char kCrashOnLive[];
extern const char kDebugDevTools[];
extern const char kDebugDevToolsFrontend[]; extern const char kDebugDevToolsFrontend[];
extern const char kDebugEnableFrameToggle[]; extern const char kDebugEnableFrameToggle[];
extern const char kDebugPrint[]; extern const char kDebugPrint[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment