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/app_modal_dialogs/javascript_dialog_manager.cc

Issue 499733002: Fixed javascript_dialog_manager to compile when extensions are disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Completely #if guarded entire GetExtensionsProcessManager function 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc
diff --git a/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc b/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc
index 417a2898d0d5c5ca24a6a3f7a3de5ec48c670b12..cc006d907b9c6d351a68ce690f11156a3252db6f 100644
--- a/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc
+++ b/chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.cc
@@ -31,16 +31,14 @@ using extensions::Extension;
namespace {
+#if defined(ENABLE_EXTENSIONS)
// Returns the ProcessManager for the browser context from |web_contents|.
extensions::ProcessManager* GetExtensionsProcessManager(
WebContents* web_contents) {
-#if defined(ENABLE_EXTENSIONS)
return extensions::ExtensionSystem::Get(
web_contents->GetBrowserContext())->process_manager();
-#else
- return NULL;
-#endif // defined(ENABLE_EXTENSIONS)
}
+#endif // ENABLE_EXTENSIONS
// Returns the extension associated with |web_contents| or NULL if there is no
// associated extension (or extensions are not supported).
@@ -50,7 +48,7 @@ const Extension* GetExtensionForWebContents(WebContents* web_contents) {
return pm->GetExtensionForRenderViewHost(web_contents->GetRenderViewHost());
#else
return NULL;
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // ENABLE_EXTENSIONS
Lei Zhang 2014/08/22 22:39:50 nit: I think most people do // defined(FOO)
David Yen 2014/08/22 23:03:58 Done.
}
// Keeps an |extension| from shutting down its lazy background page. If an
@@ -58,22 +56,26 @@ const Extension* GetExtensionForWebContents(WebContents* web_contents) {
// dialog closes.
void IncrementLazyKeepaliveCount(const Extension* extension,
WebContents* web_contents) {
+#if defined(ENABLE_EXTENSIONS)
msw 2014/08/22 22:36:10 I'm actually not sure what build errors you'd see
David Yen 2014/08/22 23:05:52 Even though technically it can never be called, th
DCHECK(extension);
DCHECK(web_contents);
extensions::ProcessManager* pm = GetExtensionsProcessManager(web_contents);
if (pm)
pm->IncrementLazyKeepaliveCount(extension);
+#endif // ENABLE_EXTENSIONS
}
// Allows an |extension| to shut down its lazy background page after a dialog
// closes (if nothing else is keeping it open).
void DecrementLazyKeepaliveCount(const Extension* extension,
WebContents* web_contents) {
+#if defined(ENABLE_EXTENSIONS)
DCHECK(extension);
DCHECK(web_contents);
extensions::ProcessManager* pm = GetExtensionsProcessManager(web_contents);
if (pm)
pm->DecrementLazyKeepaliveCount(extension);
+#endif // ENABLE_EXTENSIONS
}
class ChromeJavaScriptDialogManager : public JavaScriptDialogManager {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698