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

Side by Side Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 13305002: Remove redundant DevToolsManager methods and clean up its clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/ui/webui/inspect_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Implements the Chrome Extensions Debugger API. 5 // Implements the Chrome Extensions Debugger API.
6 6
7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h"
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 if (!webkit_glue::IsInspectorProtocolVersionSupported( 518 if (!webkit_glue::IsInspectorProtocolVersionSupported(
519 params->required_version)) { 519 params->required_version)) {
520 error_ = ErrorUtils::FormatErrorMessage( 520 error_ = ErrorUtils::FormatErrorMessage(
521 keys::kProtocolVersionNotSupportedError, 521 keys::kProtocolVersionNotSupportedError,
522 params->required_version); 522 params->required_version);
523 return false; 523 return false;
524 } 524 }
525 525
526 scoped_refptr<DevToolsAgentHost> agent(DevToolsAgentHost::GetOrCreateFor( 526 scoped_refptr<DevToolsAgentHost> agent(DevToolsAgentHost::GetOrCreateFor(
527 contents_->GetRenderViewHost())); 527 contents_->GetRenderViewHost()));
528 DevToolsClientHost* client_host = DevToolsManager::GetInstance()-> 528 if (agent->IsAttached()) {
529 GetDevToolsClientHostFor(agent);
530
531 if (client_host != NULL) {
532 FormatErrorMessage(keys::kAlreadyAttachedError); 529 FormatErrorMessage(keys::kAlreadyAttachedError);
533 return false; 530 return false;
534 } 531 }
535 532
536 new ExtensionDevToolsClientHost(contents_, 533 new ExtensionDevToolsClientHost(contents_,
537 GetExtension()->id(), 534 GetExtension()->id(),
538 GetExtension()->name(), 535 GetExtension()->name(),
539 debuggee_); 536 debuggee_);
540 SendResponse(true); 537 SendResponse(true);
541 return true; 538 return true;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 } 582 }
586 583
587 DictionaryValue* result_body; 584 DictionaryValue* result_body;
588 SendCommand::Results::Result result; 585 SendCommand::Results::Result result;
589 if (response->GetDictionary("result", &result_body)) 586 if (response->GetDictionary("result", &result_body))
590 result.additional_properties.Swap(result_body); 587 result.additional_properties.Swap(result_body);
591 588
592 results_ = SendCommand::Results::Create(result); 589 results_ = SendCommand::Results::Create(result);
593 SendResponse(true); 590 SendResponse(true);
594 } 591 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/ui/webui/inspect_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698