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

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

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 ->process_manager() 529 ->process_manager()
530 ->GetBackgroundHostForExtension(*debuggee_.extension_id); 530 ->GetBackgroundHostForExtension(*debuggee_.extension_id);
531 if (extension_host) { 531 if (extension_host) {
532 if (PermissionsData::IsRestrictedUrl(extension_host->GetURL(), 532 if (PermissionsData::IsRestrictedUrl(extension_host->GetURL(),
533 extension_host->GetURL(), 533 extension_host->GetURL(),
534 extension(), 534 extension(),
535 &error_)) { 535 &error_)) {
536 return false; 536 return false;
537 } 537 }
538 agent_host_ = DevToolsAgentHost::GetOrCreateFor( 538 agent_host_ = DevToolsAgentHost::GetOrCreateFor(
539 extension_host->render_view_host()); 539 extension_host->host_contents());
540 } 540 }
541 } else if (debuggee_.target_id) { 541 } else if (debuggee_.target_id) {
542 agent_host_ = DevToolsAgentHost::GetForId(*debuggee_.target_id); 542 agent_host_ = DevToolsAgentHost::GetForId(*debuggee_.target_id);
543 } else { 543 } else {
544 error_ = keys::kInvalidTargetError; 544 error_ = keys::kInvalidTargetError;
545 return false; 545 return false;
546 } 546 }
547 547
548 if (!agent_host_.get()) { 548 if (!agent_host_.get()) {
549 FormatErrorMessage(keys::kNoTargetError); 549 FormatErrorMessage(keys::kNoTargetError);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 const std::vector<DevToolsTargetImpl*>& target_list) { 745 const std::vector<DevToolsTargetImpl*>& target_list) {
746 scoped_ptr<base::ListValue> result(new base::ListValue()); 746 scoped_ptr<base::ListValue> result(new base::ListValue());
747 for (size_t i = 0; i < target_list.size(); ++i) 747 for (size_t i = 0; i < target_list.size(); ++i)
748 result->Append(SerializeTarget(*target_list[i])); 748 result->Append(SerializeTarget(*target_list[i]));
749 STLDeleteContainerPointers(target_list.begin(), target_list.end()); 749 STLDeleteContainerPointers(target_list.begin(), target_list.end());
750 SetResult(result.release()); 750 SetResult(result.release());
751 SendResponse(true); 751 SendResponse(true);
752 } 752 }
753 753
754 } // namespace extensions 754 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698