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

Side by Side Diff: chrome/browser/extensions/extension_devtools_bridge.cc

Issue 11308012: Remove some TabContentses from extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 "chrome/browser/extensions/extension_devtools_bridge.h" 5 #include "chrome/browser/extensions/extension_devtools_bridge.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 std::string json; 51 std::string json;
52 base::JSONWriter::Write(&message, &json); 52 base::JSONWriter::Write(&message, &json);
53 return json; 53 return json;
54 } 54 }
55 55
56 bool ExtensionDevToolsBridge::RegisterAsDevToolsClientHost() { 56 bool ExtensionDevToolsBridge::RegisterAsDevToolsClientHost() {
57 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); 57 DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
58 58
59 Browser* browser; 59 Browser* browser;
60 TabStripModel* tab_strip; 60 TabStripModel* tab_strip;
61 TabContents* contents; 61 WebContents* contents;
62 int tab_index; 62 int tab_index;
63 if (ExtensionTabUtil::GetTabById(tab_id_, profile_, true, 63 if (ExtensionTabUtil::GetTabById(tab_id_, profile_, true,
64 &browser, &tab_strip, 64 &browser, &tab_strip,
65 &contents, &tab_index)) { 65 &contents, &tab_index)) {
66 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); 66 DevToolsManager* devtools_manager = DevToolsManager::GetInstance();
67 DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( 67 DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost(
68 contents->web_contents()->GetRenderViewHost()); 68 contents->GetRenderViewHost());
69 if (devtools_manager->GetDevToolsClientHostFor(agent)) 69 if (devtools_manager->GetDevToolsClientHostFor(agent))
70 return false; 70 return false;
71 71
72 devtools_manager->RegisterDevToolsClientHostFor(agent, this); 72 devtools_manager->RegisterDevToolsClientHostFor(agent, this);
73 73
74 // Following messages depend on inspector protocol that is not yet 74 // Following messages depend on inspector protocol that is not yet
75 // finalized. 75 // finalized.
76 76
77 // 1. Start timeline profiler. 77 // 1. Start timeline profiler.
78 devtools_manager->DispatchOnInspectorBackend( 78 devtools_manager->DispatchOnInspectorBackend(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( 128 profile_->GetExtensionEventRouter()->DispatchEventToRenderers(
129 on_page_event_name_, arguments.Pass(), profile_, GURL(), 129 on_page_event_name_, arguments.Pass(), profile_, GURL(),
130 extensions::EventFilteringInfo()); 130 extensions::EventFilteringInfo());
131 } 131 }
132 132
133 void ExtensionDevToolsBridge::ContentsReplaced(WebContents* new_contents) { 133 void ExtensionDevToolsBridge::ContentsReplaced(WebContents* new_contents) {
134 // We don't update the tab id as it needs to remain the same so that we can 134 // We don't update the tab id as it needs to remain the same so that we can
135 // properly unregister. 135 // properly unregister.
136 } 136 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/browser_event_router.cc ('k') | chrome/browser/extensions/extension_tab_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698