entd: Add hooks for enterprise-specific client messages

BUG=chromium-os:21024
TEST=manual tests with old and new chrome

Change-Id: Ie4fc58e59d53346b0f4d51af2054825412a83e26
Reviewed-on: http://gerrit.chromium.org/gerrit/8577
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
diff --git a/reference_extension/client.js b/reference_extension/client.js
index c7f5b68..2361ce3 100644
--- a/reference_extension/client.js
+++ b/reference_extension/client.js
@@ -62,6 +62,24 @@
 }
 
 /**
+ * Determine if entd is deprecated based on the Chrome version.
+ */
+client.isEntdDeprecated =
+function isEntdDeprecated() {
+  var match = navigator.userAgent.match(/Chrome\/([\d]+)/);
+  if (!match || match.length != 2)
+    return false;
+  return match[1] >= 16;
+}
+
+/**
+ * Message used to indicate to the user that entd and entd-style
+ * extensions (like this reference extension) is deprecated.
+ */
+client.entdDeprecationMessage =
+    'This enterprise extension has been deprecated.';
+
+/**
  * Get a url to a resource inside the extension.
  *
  * @param {string} url The path portion of the URL you are interested in.
@@ -251,9 +269,13 @@
         if (document.location.search.match(/reload/)) {
           msg = 'Please wait while the Enterprise Daemon restarts.';
         } else {
-          msg = 'The Enterprise Daemon has not started.  Make sure you have ' +
-              'approved an enterprise certificate authority, and log out or ' +
-              'reboot after installing the policy and approving.';
+	  if (client.isEntdDeprecated()) {
+	    msg = client.entdDeprecationMessage;
+	  } else {
+            msg = 'The Enterprise Daemon has not started.  Make sure you ' +
+		'have approved an enterprise certificate authority, and log ' +
+		'out or reboot after installing the policy and approving.';
+          }
         }
 
         client.showError(msg, 'Error', { details: JSON.stringify(retval) } );
@@ -700,7 +722,7 @@
   client.showModal_(alertDialog, options.showCallback);
 
   $('.dialog-title', alertDialog).text(title || 'Alert');
-  $('.dialog-message', alertDialog).text(message || 'NO MESSAGE PROVIDED');
+  $('.dialog-message', alertDialog).html(message || 'NO MESSAGE PROVIDED');
   $('.dialog-ok', alertDialog).css('display', 'inherit');
   $('.dialog-cancel', alertDialog).css('display', 'none');
   $('.dialog-graphic', alertDialog).text('!').attr('status', '');
diff --git a/reference_extension/options.html b/reference_extension/options.html
index 40d991c..46441a9 100644
--- a/reference_extension/options.html
+++ b/reference_extension/options.html
@@ -8,6 +8,7 @@
     <script src="jquery-1.4.2.min.js"></script>
     <script src="util.js"></script>
     <script src="client.js"></script>
+    <script src="local_client.js"></script>
     <style>
       body {
         color: #3f444a;