chromium/chrome/browser/resources/chromeos/arc_support/arc_optin_focus_manager.js

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * Manages focus for ARC OptIn page.
 * @constructor
 * @extends {cr.ui.FocusManager}
 */
function ArcOptInFocusManager() {
  cr.ui.FocusManager.call(this);
}

ArcOptInFocusManager.prototype = {
  __proto__: cr.ui.FocusManager.prototype,

  /** @override */
  getFocusParent() {
    const overlay = $('overlay-container');
    if (overlay.hidden) {
      return document.body;
    } else {
      return $('overlay-page');
    }
  },
};