Mac: Make Find Bar activatable
Widgets of TYPE_CONTROL are not activatable by default. On Mac, this
means that if a user focuses the Find Bar in window B while window A
is key, window A does not lose key status, and key strokes are still
dispatched to it.
"Active" is a concept without a crisp cross-platform definition, so this
change is very narrowly scoped to Mac.
Bug: 937345
Change-Id: I4f366485eef000e5f66dbab6f8119a2a2ac93a6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2163636
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Auto-Submit: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762447}
diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc
index 1d64733..a6ac398 100644
--- a/chrome/browser/ui/views/dropdown_bar_host.cc
+++ b/chrome/browser/ui/views/dropdown_bar_host.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "build/build_config.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
@@ -54,6 +55,9 @@
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.parent = browser_view_->GetWidget()->GetNativeView();
params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
+#if defined(OS_MACOSX)
+ params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;
+#endif
host_->Init(std::move(params));
host_->SetContentsView(clip_view.release());