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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 23535002: Fixed case where _generated_background_page.html was still showing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/extensions/extension_settings_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 08ec020a14c5d231b0bdafd780d735e9bfba1de5..bc0902c32e70f1860d853423c27bfca2f7a4b582 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -1005,6 +1005,7 @@ ExtensionSettingsHandler::GetInspectablePagesForExtension(
ExtensionProcessManager* process_manager =
ExtensionSystem::Get(extension_service_->profile())->process_manager();
GetInspectablePagesForExtensionProcess(
+ extension,
process_manager->GetRenderViewHostsForExtension(extension->id()),
&result);
@@ -1032,6 +1033,7 @@ ExtensionSettingsHandler::GetInspectablePagesForExtension(
ExtensionSystem::Get(extension_service_->profile()->
GetOffTheRecordProfile())->process_manager();
GetInspectablePagesForExtensionProcess(
+ extension,
process_manager->GetRenderViewHostsForExtension(extension->id()),
&result);
@@ -1051,8 +1053,11 @@ ExtensionSettingsHandler::GetInspectablePagesForExtension(
}
void ExtensionSettingsHandler::GetInspectablePagesForExtensionProcess(
+ const Extension* extension,
const std::set<RenderViewHost*>& views,
std::vector<ExtensionPage>* result) {
+ bool has_generated_background_page =
+ BackgroundInfo::HasGeneratedBackgroundPage(extension);
for (std::set<RenderViewHost*>::const_iterator iter = views.begin();
iter != views.end(); ++iter) {
RenderViewHost* host = *iter;
@@ -1065,9 +1070,14 @@ void ExtensionSettingsHandler::GetInspectablePagesForExtensionProcess(
GURL url = web_contents->GetURL();
content::RenderProcessHost* process = host->GetProcess();
+ bool is_background_page =
+ (url == BackgroundInfo::GetBackgroundURL(extension));
result->push_back(
- ExtensionPage(url, process->GetID(), host->GetRoutingID(),
- process->GetBrowserContext()->IsOffTheRecord(), false));
+ ExtensionPage(url,
+ process->GetID(),
+ host->GetRoutingID(),
+ process->GetBrowserContext()->IsOffTheRecord(),
+ is_background_page && has_generated_background_page));
}
}
@@ -1081,16 +1091,22 @@ void ExtensionSettingsHandler::GetShellWindowPagesForExtensionProfile(
const apps::ShellWindowRegistry::ShellWindowList windows =
registry->GetShellWindowsForApp(extension->id());
+ bool has_generated_background_page =
+ BackgroundInfo::HasGeneratedBackgroundPage(extension);
for (apps::ShellWindowRegistry::const_iterator it = windows.begin();
it != windows.end(); ++it) {
WebContents* web_contents = (*it)->web_contents();
RenderViewHost* host = web_contents->GetRenderViewHost();
content::RenderProcessHost* process = host->GetProcess();
+ bool is_background_page =
+ (web_contents->GetURL() == BackgroundInfo::GetBackgroundURL(extension));
result->push_back(
- ExtensionPage(web_contents->GetURL(), process->GetID(),
+ ExtensionPage(web_contents->GetURL(),
+ process->GetID(),
host->GetRoutingID(),
- process->GetBrowserContext()->IsOffTheRecord(), false));
+ process->GetBrowserContext()->IsOffTheRecord(),
+ is_background_page && has_generated_background_page));
}
}
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698