Index: modules/overlay/overlay-child.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.css,v
retrieving revision 1.6
diff -u -p -r1.6 overlay-child.css
--- modules/overlay/overlay-child.css	28 Jul 2010 01:26:00 -0000	1.6
+++ modules/overlay/overlay-child.css	1 Nov 2010 16:24:27 -0000
@@ -7,6 +7,8 @@ html.js {
 html.js body {
   background: transparent !important;
   padding: 20px 0;
+  margin-left: 0;
+  margin-right: 0;
 }
 
 #overlay {
@@ -138,3 +140,29 @@ html.js body {
 * html #overlay-close:hover {
   position: absolute;
 }
+
+/**
+ * Disable message.
+ */
+#overlay-disable-message {
+  background-color: #fff;
+  margin: -20px auto 20px;
+  width: 80%;
+  -moz-border-radius: 0 0 8px 8px;
+  -webkit-border-bottom-left-radius: 8px;
+  -webkit-border-bottom-right-radius: 8px;
+  border-radius: 0 0 8px 8px;
+}
+.overlay-disable-message-focused {
+  padding: 0 0.5em 0.5em 0.5em;
+}
+.overlay-disable-message-focused a {
+  display: block;
+  float: left;
+  margin-top: 1em;
+}
+.overlay-disable-message-focused a.button {
+  float: right;
+  margin-bottom: 0;
+  margin-right: 0;
+}
Index: modules/overlay/overlay-child.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-child.js,v
retrieving revision 1.10
diff -u -p -r1.10 overlay-child.js
--- modules/overlay/overlay-child.js	8 Jul 2010 12:20:23 -0000	1.10
+++ modules/overlay/overlay-child.js	1 Nov 2010 16:24:27 -0000
@@ -57,6 +57,19 @@ Drupal.behaviors.overlayChild = {
 
     // Attach child related behaviors to the iframe document.
     Drupal.overlayChild.attachBehaviors(context, settings);
+
+    // There are two links within the message that informs people about the
+    // overlay and how to disable it. Make sure both links are visible when
+    // either one has focus and add a class to the wrapper for styling purposes.
+    $('#overlay-disable-message', context)
+      .focusin(function () {
+        $(this).addClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).removeClass('element-invisible');
+      })
+      .focusout(function () {
+        $(this).removeClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).addClass('element-invisible');
+      });
   }
 };
 
Index: modules/overlay/overlay-parent.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.css,v
retrieving revision 1.15
diff -u -p -r1.15 overlay-parent.css
--- modules/overlay/overlay-parent.css	8 Jun 2010 05:16:29 -0000	1.15
+++ modules/overlay/overlay-parent.css	1 Nov 2010 16:24:27 -0000
@@ -46,3 +46,27 @@ html.overlay-open .displace-bottom {
 {
   position: absolute;
 }
+
+/**
+ * Disable message.
+ */
+#overlay-disable-message {
+  background-color: #fff;
+  display: none;
+}
+html.overlay-open #overlay-disable-message {
+  display: block;
+}
+.overlay-disable-message-focused {
+  padding: 0 0.5em 0.5em 0.5em;
+}
+.overlay-disable-message-focused a {
+  display: block;
+  float: left;
+  margin-top: 1em;
+}
+.overlay-disable-message-focused a.button {
+  float: right;
+  margin-bottom: 0;
+  margin-right: 0;
+}
Index: modules/overlay/overlay-parent.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v
retrieving revision 1.56
diff -u -p -r1.56 overlay-parent.js
--- modules/overlay/overlay-parent.js	30 Oct 2010 03:44:37 -0000	1.56
+++ modules/overlay/overlay-parent.js	1 Nov 2010 16:24:27 -0000
@@ -29,6 +29,19 @@ Drupal.behaviors.overlayParent = {
       // scripts to bind their own handlers to links and also to prevent
       // overlay's handling.
       .bind('click.drupal-overlay mouseup.drupal-overlay', $.proxy(Drupal.overlay, 'eventhandlerOverrideLink'));
+
+    // There are two links within the message that informs people about the
+    // overlay and how to disable it. Make sure both links are visible when
+    // either one has focus and add a class to the wrapper for styling purposes.
+    $('#overlay-disable-message', context)
+      .focusin(function () {
+        $(this).addClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).removeClass('element-invisible');
+      })
+      .focusout(function () {
+        $(this).removeClass('overlay-disable-message-focused');
+        $('a.element-focusable', this).addClass('element-invisible');
+      });
   }
 };
 
Index: modules/overlay/overlay.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v
retrieving revision 1.31
diff -u -p -r1.31 overlay.module
--- modules/overlay/overlay.module	31 Aug 2010 15:04:09 -0000	1.31
+++ modules/overlay/overlay.module	1 Nov 2010 16:24:27 -0000
@@ -30,10 +30,29 @@ function overlay_menu() {
     'access arguments' => array('access overlay'),
     'type' => MENU_CALLBACK,
   );
+  $items['overlay/dismiss-message'] = array(
+    'title' => '',
+    'page callback' => 'overlay_user_dismiss_message',
+    'access arguments' => array('access overlay'),
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
 
 /**
+ * Implements hook_admin_paths().
+ */
+function overlay_admin_paths() {
+  $paths = array(
+    // This is marked as an administrative path so that if it is visited from
+    // within the overlay, the user will stay within the overlay while the
+    // callback is being processed.
+    'overlay/dismiss-message' => TRUE,
+  );
+  return $paths;
+}
+
+/**
  * Implements hook_permission().
  */
 function overlay_permission() {
@@ -54,6 +73,9 @@ function overlay_theme() {
       'render element' => 'page',
       'template' => 'overlay',
     ),
+    'overlay_disable_message' => array(
+      'render element' => 'element',
+    ),
   );
 }
 
@@ -254,10 +276,123 @@ function overlay_page_alter(&$page) {
     }
   }
 
-  if (overlay_get_mode() == 'child') {
+  $mode = overlay_get_mode();
+  if ($mode == 'child') {
     // Add the overlay wrapper before the html wrapper.
     array_unshift($page['#theme_wrappers'], 'overlay');
   }
+  elseif ($mode == 'parent' && ($message = overlay_disable_message())) {
+    $page['page_top']['disable_overlay'] = $message;
+  }
+}
+
+/**
+ * Menu callback; dismisses the overlay accessibility message for this user.
+ */
+function overlay_user_dismiss_message() {
+  global $user;
+  // It's unlikely, but possible that "access overlay" permission is granted to
+  // the anonymous role. In this case, we do not display the message to disable
+  // the overlay, so there is nothing to dismiss. Also, protect against
+  // cross-site request forgeries by validating a token.
+  if (empty($user->uid) || !isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'overlay')) {
+    return MENU_ACCESS_DENIED;
+  }
+  else {
+    user_save(user_load($user->uid), array('data' => array('overlay_message_dismissed' => 1)));
+    drupal_set_message(t('The message has been dismissed. You can change your overlay settings at any time by visiting your profile page.'));
+    // Destination is normally given. Go to the user profile as a fallback.
+    drupal_goto('user/' . $user->uid . '/edit');
+  }
+}
+
+/**
+ * Returns a renderable array representing a message for disabling the overlay.
+ *
+ * If the current user can access the overlay and has not previously indicated
+ * that this message should be dismissed, this function returns a message
+ * containing a link to disable the overlay. Nothing is returned for anonymous
+ * users, because the links control per-user settings. Therefore, because some
+ * screen readers are unable to properly read overlay contents, site builders
+ * are discouraged from granting the "access overlay" permission to the
+ * anonymous role. See http://drupal.org/node/896364.
+ */
+function overlay_disable_message() {
+  global $user;
+
+  if (!empty($user->uid) && empty($user->data['overlay_message_dismissed']) && (!isset($user->data['overlay']) || $user->data['overlay']) && user_access('access overlay')) {
+    $build = array(
+      '#theme' => array('overlay_disable_message'),
+      '#weight' => -99,
+      // Link to the user's profile page, where the overlay can be disabled.
+      'profile_link' => array(
+        '#type' => 'link',
+        '#title' => t('If you have problems accessing administrative pages on this site, disable the overlay on your profile page.'),
+        '#href' => 'user/' . $user->uid . '/edit',
+        '#options' => array(
+          'query' => drupal_get_destination(),
+          'fragment' => 'edit-overlay-control',
+          'attributes' => array(
+            'id' => 'overlay-profile-link',
+            // Prevent the target page from being opened in the overlay.
+            'class' => array('overlay-exclude'),
+          ),
+        ),
+      ),
+      // Link to a menu callback that allows this message to be permanently
+      // dismissed for the current user.
+      'dismiss_message_link' => array(
+        '#type' => 'link',
+        '#title' => t('Dismiss this message.'),
+        '#href' => 'overlay/dismiss-message',
+        '#options' => array(
+          'query' => drupal_get_destination() + array(
+            // Add a token to protect against cross-site request forgeries.
+            'token' => drupal_get_token('overlay'),
+          ),
+          'attributes' => array(
+            'id' => 'overlay-dismiss-message',
+            // If this message is being displayed outside the overlay, prevent
+            // this link from opening the overlay.
+            'class' => (overlay_get_mode() == 'parent') ? array('overlay-exclude') : array(),
+          ),
+        ),
+      )
+    );
+  }
+  else {
+    $build = array();
+  }
+
+  return $build;
+}
+
+/**
+ * Returns the rendered HTML for the message about how to disable the overlay.
+ *
+ * @see overlay_disable_message()
+ */
+function theme_overlay_disable_message($variables) {
+  $element = $variables['element'];
+
+  // Add CSS classes to hide the links from most sighted users, while keeping
+  // them available to screen reader users and keyboard only users. When the
+  // Dismiss link is visible, make it look like a button.
+  $element['profile_link']['#options']['attributes']['class'] = array_merge($element['profile_link']['#options']['attributes']['class'], array('element-invisible', 'element-focusable'));
+  $element['dismiss_message_link']['#options']['attributes']['class'] = array_merge($element['dismiss_message_link']['#options']['attributes']['class'], array('element-invisible', 'element-focusable', 'button'));
+
+  // Render the links with a leading space.
+  // @todo Remove leading space or add comment explaining why it's needed.
+  $output = ' ' . drupal_render_children($element);
+
+  // Add a heading for screen reader users. The heading doesn't need to be seen
+  // by sighted users.
+  $output = '<h3 class="element-invisible">' . t('Options for the administrative overlay') . '</h3>' . $output;
+
+  // Wrap in a container for styling.
+  $output = '<div id="overlay-disable-message" class="clearfix">' . $output . '</div>';
+
+  return $output;
 }
 
 /**
@@ -324,9 +459,9 @@ function overlay_preprocess_maintenance_
  * @see overlay.tpl.php
  */
 function template_preprocess_overlay(&$variables) {
-  $variables['tabs']              = menu_primary_local_tasks();
-  $variables['title']             = drupal_get_title();
-
+  $variables['tabs'] = menu_primary_local_tasks();
+  $variables['title'] = drupal_get_title();
+  $variables['disable_overlay'] = overlay_disable_message();
   $variables['content_attributes_array']['class'][] = 'clearfix';
 }
 
Index: modules/overlay/overlay.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.tpl.php,v
retrieving revision 1.4
diff -u -p -r1.4 overlay.tpl.php
--- modules/overlay/overlay.tpl.php	16 Sep 2010 19:47:45 -0000	1.4
+++ modules/overlay/overlay.tpl.php	1 Nov 2010 16:24:27 -0000
@@ -21,6 +21,7 @@
  */
 ?>
 
+<?php print render($disable_overlay); ?>
 <div id="overlay" <?php print $attributes; ?>>
   <div id="overlay-titlebar" class="clearfix">
     <div id="overlay-title-wrapper" class="clearfix">
Index: themes/seven/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/style.css,v
retrieving revision 1.81
diff -u -p -r1.81 style.css
--- themes/seven/style.css	30 Oct 2010 03:52:14 -0000	1.81
+++ themes/seven/style.css	1 Nov 2010 16:24:33 -0000
@@ -971,3 +971,17 @@ div.add-or-remove-shortcuts {
 #user-login-form .openid-links .user-link {
   margin-left: 1.5em; /* LTR */
 }
+
+/* Disable overlay message */
+#overlay-disable-message {
+  background-color: #ADDAFC;
+}
+#overlay-disable-message a,
+#overlay-disable-message a:visited {
+  color: #000;
+}
+#overlay-disable-message a:focus,
+#overlay-disable-message a:active {
+  text-decoration: underline;
+  outline: none;
+}
