remove-focusring-from-locationbar.patch 1.1 KB

123456789101112131415161718192021222324252627
  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. @@ -169,20 +169,6 @@ LocationBarView::LocationBarView(Browser
  7. is_popup_mode_(is_popup_mode) {
  8. set_suppress_default_focus_handling();
  9. if (!is_popup_mode_) {
  10. - views::FocusRing::Install(this);
  11. - views::FocusRing::Get(this)->SetHasFocusPredicate([](View* view) -> bool {
  12. - DCHECK(views::IsViewClass<LocationBarView>(view));
  13. - auto* v = static_cast<LocationBarView*>(view);
  14. -
  15. - // Show focus ring when the Omnibox is visibly focused and the popup is
  16. - // closed.
  17. - return v->omnibox_view_->model()->is_caret_visible() &&
  18. - !v->GetOmniboxPopupView()->IsOpen();
  19. - });
  20. -
  21. - views::FocusRing::Get(this)->SetPathGenerator(
  22. - std::make_unique<views::PillHighlightPathGenerator>());
  23. -
  24. #if defined(OS_MAC)
  25. geolocation_permission_observation_.Observe(
  26. g_browser_process->platform_part()->geolocation_manager());