New issue
Advanced search Search tips

Issue 838698 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug

Blocking:
issue 841758



Sign in to add a comment

Refactor infobars in iOS

Project Member Reported by mahmadi@chromium.org, May 1 2018

Issue description

Currently, infobars provide little flexibility in the type, number, and layout of the items they display. Furthermore, user interactions with the infobars are handled in a generic context requiring multiple if/else statements for detecting the type of the InfoBar and the interacted element. This is an effort to refactor infobars in iOS to have more flexibility in their layout and functionality.
 
Labels: Restrict-View-Google
Design Doc: go/refactor-infobars-bling
Labels: -Restrict-View-Google
Project Member

Comment 4 by bugdroid1@chromium.org, May 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f

commit fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f
Author: Moe Ahmadi <mahmadi@chromium.org>
Date: Wed May 09 15:19:31 2018

[IOS] Refactors infobars

Currently, infobars provide little flexibility in the type, number, and layout of the items they
display. Furthermore, user interactions with the infobars are handled in a generic context of
InfoBarIOS class requiring multiple if/else statements to detect the type of the InfoBar and the
interacted element. This is an effort to refactor infobars to have more flexibility in their layout
and functionality (more info in the reference bugs).

This CL primarily makes the following changes:

1) Moves the logic in InfoBarIOS (chrome/browser/ui/ios/infobar.mm) related to the confirm infobar
   and translate infobar to their respective infobar controller (e.g., ConfirmInfoBarController)
2) Introduces a new protocol InfoBarViewSizing adopted by the infobar views. It contains a target
   height property used by the infobar container for animation purposes and properly setting the
   infobar view's frame.
3) Introduces a new protocol InfoBarViewSizingDelegate adopted by the infobar controller that gets
   notified of infobar view's size changes and relays it to the InfoBarIOS.
4) Introduces a new interface InfoBarControllerDelegate implemented by InfoBarIOS which gets
   notified of infobar view's size changes and when the infobar needs to be closed.

Bug:  838698 , 307552

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I7b8f9cc258d531ed99e84ffc02edcb323561bb8c
Reviewed-on: https://chromium-review.googlesource.com/1037640
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Peter Lee <pkl@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557188}
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/BUILD.gn
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/confirm_infobar_controller+protected.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/confirm_infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/confirm_infobar_controller.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar_container_view.mm
[add] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar_controller+protected.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar_controller.mm
[add] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar_controller_delegate.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/infobars/infobar_utils.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegate.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/passwords/update_password_infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/passwords/update_password_infobar_controller.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/after_translate_infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/after_translate_infobar_controller.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/before_translate_infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/before_translate_infobar_controller.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/chrome_ios_translate_client.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/never_translate_infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/never_translate_infobar_controller.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/translate_message_infobar_controller.h
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/translate/translate_message_infobar_controller.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm
[modify] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/infobars/BUILD.gn
[rename] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/infobars/confirm_infobar_view.h
[rename] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/infobars/confirm_infobar_view.mm
[add] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/infobars/confirm_infobar_view_unittest.mm
[delete] https://crrev.com/e4a57b1abea70983f098f111a0e94fb7fe728bdf/ios/chrome/browser/ui/infobars/infobar_view_delegate.h
[add] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/infobars/infobar_view_sizing.h
[add] https://crrev.com/fdfbd477a57424fe2f1b8667e7d5a9f2a7c5c34f/ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h
[delete] https://crrev.com/e4a57b1abea70983f098f111a0e94fb7fe728bdf/ios/chrome/browser/ui/infobars/infobar_view_unittest.mm

Status: Fixed (was: Started)
Project Member

Comment 6 by bugdroid1@chromium.org, May 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3d1eea29af6e01f2c7e14d60564131f94dae9d6c

commit 3d1eea29af6e01f2c7e14d60564131f94dae9d6c
Author: Moe Ahmadi <mahmadi@chromium.org>
Date: Thu May 10 01:26:41 2018

[IOS] Implements opening URLs from infobars

Bug:  838698 

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I614fdefa788214f4d0bf40b95f868a677f63573b
Reviewed-on: https://chromium-review.googlesource.com/1051011
Reviewed-by: Peter Lee <pkl@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557408}
[modify] https://crrev.com/3d1eea29af6e01f2c7e14d60564131f94dae9d6c/ios/chrome/browser/infobars/infobar_manager_impl.mm

Blocking: 841758

Sign in to add a comment