OLD | NEW |
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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 params->required_version); | 579 params->required_version); |
580 return false; | 580 return false; |
581 } | 581 } |
582 | 582 |
583 if (agent_host_->IsAttached()) { | 583 if (agent_host_->IsAttached()) { |
584 FormatErrorMessage(keys::kAlreadyAttachedError); | 584 FormatErrorMessage(keys::kAlreadyAttachedError); |
585 return false; | 585 return false; |
586 } | 586 } |
587 | 587 |
588 infobars::InfoBar* infobar = NULL; | 588 infobars::InfoBar* infobar = NULL; |
589 if (!CommandLine::ForCurrentProcess()-> | 589 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
590 HasSwitch(::switches::kSilentDebuggerExtensionAPI)) { | 590 ::switches::kSilentDebuggerExtensionAPI)) { |
591 // Do not attach to the target if for any reason the infobar cannot be shown | 591 // Do not attach to the target if for any reason the infobar cannot be shown |
592 // for this WebContents instance. | 592 // for this WebContents instance. |
593 infobar = ExtensionDevToolsInfoBarDelegate::Create( | 593 infobar = ExtensionDevToolsInfoBarDelegate::Create( |
594 agent_host_->GetWebContents(), extension()->name()); | 594 agent_host_->GetWebContents(), extension()->name()); |
595 if (!infobar) { | 595 if (!infobar) { |
596 error_ = ErrorUtils::FormatErrorMessage( | 596 error_ = ErrorUtils::FormatErrorMessage( |
597 keys::kSilentDebuggingRequired, | 597 keys::kSilentDebuggingRequired, |
598 ::switches::kSilentDebuggerExtensionAPI); | 598 ::switches::kSilentDebuggerExtensionAPI); |
599 return false; | 599 return false; |
600 } | 600 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 const std::vector<DevToolsTargetImpl*>& target_list) { | 734 const std::vector<DevToolsTargetImpl*>& target_list) { |
735 scoped_ptr<base::ListValue> result(new base::ListValue()); | 735 scoped_ptr<base::ListValue> result(new base::ListValue()); |
736 for (size_t i = 0; i < target_list.size(); ++i) | 736 for (size_t i = 0; i < target_list.size(); ++i) |
737 result->Append(SerializeTarget(*target_list[i])); | 737 result->Append(SerializeTarget(*target_list[i])); |
738 STLDeleteContainerPointers(target_list.begin(), target_list.end()); | 738 STLDeleteContainerPointers(target_list.begin(), target_list.end()); |
739 SetResult(result.release()); | 739 SetResult(result.release()); |
740 SendResponse(true); | 740 SendResponse(true); |
741 } | 741 } |
742 | 742 |
743 } // namespace extensions | 743 } // namespace extensions |
OLD | NEW |