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 #include "chrome/browser/devtools/browser_list_tabcontents_provider.h" | 5 #include "chrome/browser/devtools/browser_list_tabcontents_provider.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return kTargetTypeTab; | 109 return kTargetTypeTab; |
110 | 110 |
111 return kTargetTypeOther; | 111 return kTargetTypeOther; |
112 } | 112 } |
113 | 113 |
114 std::string BrowserListTabContentsProvider::GetViewDescription( | 114 std::string BrowserListTabContentsProvider::GetViewDescription( |
115 content::RenderViewHost* rvh) { | 115 content::RenderViewHost* rvh) { |
116 content::WebContents* web_contents = | 116 content::WebContents* web_contents = |
117 content::WebContents::FromRenderViewHost(rvh); | 117 content::WebContents::FromRenderViewHost(rvh); |
118 if (!web_contents) | 118 if (!web_contents) |
119 return ""; | 119 return std::string(); |
120 | 120 |
121 Profile* profile = | 121 Profile* profile = |
122 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 122 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
123 if (!profile) | 123 if (!profile) |
124 return ""; | 124 return std::string(); |
125 | 125 |
126 extensions::ExtensionHost* extension_host = | 126 extensions::ExtensionHost* extension_host = |
127 extensions::ExtensionSystem::Get(profile)->process_manager()-> | 127 extensions::ExtensionSystem::Get(profile)->process_manager()-> |
128 GetBackgroundHostForExtension(web_contents->GetURL().host()); | 128 GetBackgroundHostForExtension(web_contents->GetURL().host()); |
129 | 129 |
130 if (!extension_host || extension_host->host_contents() != web_contents) | 130 if (!extension_host || extension_host->host_contents() != web_contents) |
131 return ""; | 131 return std::string(); |
132 | 132 |
133 return extension_host->extension()->name(); | 133 return extension_host->extension()->name(); |
134 } | 134 } |
OLD | NEW |