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

Side by Side Diff: chrome/browser/debugger/devtools_window.cc

Issue 11361034: DevTools: [remote debugging] emit Inspector.detached protocol message upon connectin termination. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment addressed Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 RenderViewHost* inspected_rvh, 648 RenderViewHost* inspected_rvh,
649 bool force_open, 649 bool force_open,
650 DevToolsToggleAction action) { 650 DevToolsToggleAction action) {
651 DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( 651 DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost(
652 inspected_rvh); 652 inspected_rvh);
653 DevToolsManager* manager = DevToolsManager::GetInstance(); 653 DevToolsManager* manager = DevToolsManager::GetInstance();
654 DevToolsClientHost* host = manager->GetDevToolsClientHostFor(agent); 654 DevToolsClientHost* host = manager->GetDevToolsClientHostFor(agent);
655 DevToolsWindow* window = AsDevToolsWindow(host); 655 DevToolsWindow* window = AsDevToolsWindow(host);
656 if (host && !window) { 656 if (host && !window) {
657 // Break remote debugging / extension debugging session. 657 // Break remote debugging / extension debugging session.
658 DebuggerApi::MarkDevToolsClientHostAsReplaced(host); 658 host->ReplacedWithAnotherClient();
659 manager->UnregisterDevToolsClientHostFor(agent); 659 manager->UnregisterDevToolsClientHostFor(agent);
660 } 660 }
661 661
662 bool do_open = force_open; 662 bool do_open = force_open;
663 if (!window) { 663 if (!window) {
664 Profile* profile = Profile::FromBrowserContext( 664 Profile* profile = Profile::FromBrowserContext(
665 inspected_rvh->GetProcess()->GetBrowserContext()); 665 inspected_rvh->GetProcess()->GetBrowserContext());
666 DevToolsDockSide dock_side = GetDockSideFromPrefs(profile); 666 DevToolsDockSide dock_side = GetDockSideFromPrefs(profile);
667 window = Create(profile, inspected_rvh, dock_side, false); 667 window = Create(profile, inspected_rvh, dock_side, false);
668 manager->RegisterDevToolsClientHostFor(agent, window->frontend_host_); 668 manager->RegisterDevToolsClientHostFor(agent, window->frontend_host_);
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 890
891 // static 891 // static
892 DevToolsDockSide DevToolsWindow::SideFromString( 892 DevToolsDockSide DevToolsWindow::SideFromString(
893 const std::string& dock_side) { 893 const std::string& dock_side) {
894 if (dock_side == kDockSideRight) 894 if (dock_side == kDockSideRight)
895 return DEVTOOLS_DOCK_SIDE_RIGHT; 895 return DEVTOOLS_DOCK_SIDE_RIGHT;
896 if (dock_side == kDockSideBottom) 896 if (dock_side == kDockSideBottom)
897 return DEVTOOLS_DOCK_SIDE_BOTTOM; 897 return DEVTOOLS_DOCK_SIDE_BOTTOM;
898 return DEVTOOLS_DOCK_SIDE_UNDOCKED; 898 return DEVTOOLS_DOCK_SIDE_UNDOCKED;
899 } 899 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698