Don't allow more than one pending print dialog per browser instance.

As a future TODO, it might be nice to limit it per-tab instead of per-app.

BUG=46575
TEST=manual

Review URL: http://codereview.chromium.org/2848011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50203 0039d316-1c4b-4281-b951-d872f2087c98
static XID GetTopLevelWindow(XID window) {
  bool parent_is_root;
  XID parent_window;

  if (!x11_util::GetWindowParent(&parent_window, &parent_is_root, window))
    return 0;
  if (parent_is_root)
    return window;

  return GetTopLevelWindow(parent_window);
}

static XID GetTopLevelWindow(XID window) {
  bool parent_is_root;
  XID parent_window;

  if (!x11_util::GetWindowParent(&parent_window, &parent_is_root, window))
    return 0;
  if (parent_is_root)
    return window;

  return GetTopLevelWindow(parent_window);
}
