From 482e7000aecdd41d39aa0af33fc19dafb1b51c85 Mon Sep 17 00:00:00 2001
From: "gyuyoung.kim@samsung.com"
 <gyuyoung.kim@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 10 Dec 2013 07:13:15 +0000
Subject: [PATCH] Add a flag for enabling/disabling the navigator content utils

As a part of removing ENABLE(NAVIGATOR_CONTENT_UTILS), this cl add a flag for the navigator content utils
and enable it except for android.

BUG=N/A

Review URL: https://codereview.chromium.org/104123003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239691 0039d316-1c4b-4281-b951-d872f2087c98
---
 content/child/runtime_features.cc         | 5 +++++
 content/public/common/content_switches.cc | 4 ++++
 content/public/common/content_switches.h  | 1 +
 3 files changed, 10 insertions(+)

diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 2d6925e90db97..66fa73a25fc83 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -40,6 +40,8 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
   WebRuntimeFeatures::enableNotifications(false);
   // Android does not yet support SharedWorker. crbug.com/154571
   WebRuntimeFeatures::enableSharedWorker(false);
+  // Android does not yet support NavigatorContentUtils.
+  WebRuntimeFeatures::enableNavigatorContentUtils(false);
 #endif  // defined(OS_ANDROID)
 }
 
@@ -61,6 +63,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
   if (command_line.HasSwitch(switches::kDisableDesktopNotifications))
     WebRuntimeFeatures::enableNotifications(false);
 
+  if (command_line.HasSwitch(switches::kDisableNavigatorContentUtils))
+    WebRuntimeFeatures::enableNavigatorContentUtils(false);
+
   if (command_line.HasSwitch(switches::kDisableLocalStorage))
     WebRuntimeFeatures::enableLocalStorage(false);
 
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index f7773a22b173e..3dfac67e87f8f 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -151,6 +151,10 @@ const char kDisableDelegatedRenderer[]      = "disable-delegated-renderer";
 // Disables desktop notifications (default enabled on windows).
 const char kDisableDesktopNotifications[]   = "disable-desktop-notifications";
 
+// Disables experimental navigator content utils implementation.
+const char kDisableNavigatorContentUtils[]  =
+      "disable-navigator-content-utils";
+
 // Disable device motion events.
 const char kDisableDeviceMotion[]           = "disable-device-motion";
 
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index f91e565cfa915..23960b100267c 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -86,6 +86,7 @@ CONTENT_EXPORT extern const char kDisablePrefixedEncryptedMedia[];
 extern const char kDisableKillAfterBadIPC[];
 CONTENT_EXPORT extern const char kDisableLocalStorage[];
 CONTENT_EXPORT extern const char kDisableLogging[];
+extern const char kDisableNavigatorContentUtils[];
 extern const char kDisablePepper3d[];
 CONTENT_EXPORT extern const char kDisablePinch[];
 CONTENT_EXPORT extern const char kDisablePlugins[];