remove-focusring-from-locationbar.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. ## This patch removes the focus ring from the location bar.
  2. #
  3. # Alternatively the color could be changed with focus_ring_->SetColor(SkColor).
  4. --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
  5. +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
  6. @@ -152,26 +152,6 @@ LocationBarView::LocationBarView(Browser
  7. profile_(profile),
  8. delegate_(delegate),
  9. is_popup_mode_(is_popup_mode) {
  10. - if (!is_popup_mode_) {
  11. - focus_ring_ = views::FocusRing::Install(this);
  12. - focus_ring_->SetHasFocusPredicate([](View* view) -> bool {
  13. - DCHECK(views::IsViewClass<LocationBarView>(view));
  14. - auto* v = static_cast<LocationBarView*>(view);
  15. -
  16. - // Show focus ring when the Omnibox is visibly focused and the popup is
  17. - // closed.
  18. - return v->omnibox_view_->model()->is_caret_visible() &&
  19. - !v->GetOmniboxPopupView()->IsOpen();
  20. - });
  21. -
  22. - focus_ring_->SetPathGenerator(
  23. - std::make_unique<views::PillHighlightPathGenerator>());
  24. -
  25. -#if defined(OS_MAC)
  26. - geolocation_permission_observation_.Observe(
  27. - g_browser_process->platform_part()->location_permission_manager());
  28. -#endif
  29. - }
  30. }
  31. LocationBarView::~LocationBarView() = default;