return BrowserView::GetBrowserViewForBrowser(browser_)
->toolbar()
->GetExtensionsButton();I assume this code was never executed because `GetReferenceButtonForPopup()` was called only for the toolbar action's delegate.
return GetFocusManager();I assume that `GetFocusManager()` returns the same instance within the same window.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
return GetFocusManager();I assume that `GetFocusManager()` returns the same instance within the same window.
Yes! As long as the views are all parented to the same widget, `GetFocusManager()` will be the same 👍
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Thanks Shuhei!
return BrowserView::GetBrowserViewForBrowser(browser_)
->toolbar()
->GetExtensionsButton();I assume this code was never executed because `GetReferenceButtonForPopup()` was called only for the toolbar action's delegate.
I would expect this to be triggered when extensions menu button is pressed and popup is triggered. Extensions menu button should be the delegate of the action view controller that is called when the action is executed: `ExtensionsMenuButton::ButtonPressed()` -> ` ExtensionActionViewController::ExecuteUserAction` -> ... -> `ExtensionActionPlatformDelegateViews::ShowPopup` -> `GetDelegateViews()->GetReferenceButtonForPopup()` where the delegate is the extensions menu button.
That being said, if this is called then the popup reference button would be the extensions button (puzzle piece) and not the action in the toolbar.. which is not what happens.
Code is so tangled that maybe somewhere else we are using the other controller. Thus, changing this to be in the container and always returning the toolbar action view as the popup reference button seems like a great improvement!
Tested the CL locally to make sure the popup is correctly anchored and button focused. Looks good!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Thanks for reviews! I need your approval again as I lost CR+2 on rebasing.
return BrowserView::GetBrowserViewForBrowser(browser_)
->toolbar()
->GetExtensionsButton();Emilia PazI assume this code was never executed because `GetReferenceButtonForPopup()` was called only for the toolbar action's delegate.
I would expect this to be triggered when extensions menu button is pressed and popup is triggered. Extensions menu button should be the delegate of the action view controller that is called when the action is executed: `ExtensionsMenuButton::ButtonPressed()` -> ` ExtensionActionViewController::ExecuteUserAction` -> ... -> `ExtensionActionPlatformDelegateViews::ShowPopup` -> `GetDelegateViews()->GetReferenceButtonForPopup()` where the delegate is the extensions menu button.
That being said, if this is called then the popup reference button would be the extensions button (puzzle piece) and not the action in the toolbar.. which is not what happens.
Code is so tangled that maybe somewhere else we are using the other controller. Thus, changing this to be in the container and always returning the toolbar action view as the popup reference button seems like a great improvement!Tested the CL locally to make sure the popup is correctly anchored and button focused. Looks good!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Returns the FocusManager to use when registering accelerators.
virtual views::FocusManager* GetFocusManagerForAccelerator() = 0;
// Returns the reference button for the extension action's popup. Rather than
// relying on the button being a MenuButton, the button returned should have a
// MenuButtonController. This is part of the ongoing work from
// http://crbug.com/901183 to simplify the button hierarchy by migrating
// controller logic into a separate class leaving MenuButton as an empty class
// to be deprecated.
virtual views::BubbleAnchor GetReferenceButtonForPopup(
const extensions::ExtensionId& action_id) = 0;I should have caught the use of `views::View` here. This CL will depend on comment thread [here](https://chromium-review.googlesource.com/c/chromium/src/+/7064871/comments/35002115_8ecbf796)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Returns the FocusManager to use when registering accelerators.
virtual views::FocusManager* GetFocusManagerForAccelerator() = 0;
// Returns the reference button for the extension action's popup. Rather than
// relying on the button being a MenuButton, the button returned should have a
// MenuButtonController. This is part of the ongoing work from
// http://crbug.com/901183 to simplify the button hierarchy by migrating
// controller logic into a separate class leaving MenuButton as an empty class
// to be deprecated.
virtual views::BubbleAnchor GetReferenceButtonForPopup(
const extensions::ExtensionId& action_id) = 0;I should have caught the use of `views::View` here. This CL will depend on comment thread [here](https://chromium-review.googlesource.com/c/chromium/src/+/7064871/comments/35002115_8ecbf796)
Ack. I will put this on hold until we resolve the thread.
// Returns the FocusManager to use when registering accelerators.
virtual views::FocusManager* GetFocusManagerForAccelerator() = 0;
// Returns the reference button for the extension action's popup. Rather than
// relying on the button being a MenuButton, the button returned should have a
// MenuButtonController. This is part of the ongoing work from
// http://crbug.com/901183 to simplify the button hierarchy by migrating
// controller logic into a separate class leaving MenuButton as an empty class
// to be deprecated.
virtual views::BubbleAnchor GetReferenceButtonForPopup(
const extensions::ExtensionId& action_id) = 0;Shuhei TakahashiI should have caught the use of `views::View` here. This CL will depend on comment thread [here](https://chromium-review.googlesource.com/c/chromium/src/+/7064871/comments/35002115_8ecbf796)
Ack. I will put this on hold until we resolve the thread.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Returns the FocusManager to use when registering accelerators.
virtual views::FocusManager* GetFocusManagerForAccelerator() = 0;
// Returns the reference button for the extension action's popup. Rather than
// relying on the button being a MenuButton, the button returned should have a
// MenuButtonController. This is part of the ongoing work from
// http://crbug.com/901183 to simplify the button hierarchy by migrating
// controller logic into a separate class leaving MenuButton as an empty class
// to be deprecated.
virtual views::BubbleAnchor GetReferenceButtonForPopup(
const extensions::ExtensionId& action_id) = 0;Shuhei TakahashiI should have caught the use of `views::View` here. This CL will depend on comment thread [here](https://chromium-review.googlesource.com/c/chromium/src/+/7064871/comments/35002115_8ecbf796)
Shuhei TakahashiAck. I will put this on hold until we resolve the thread.
Resolved.
Will rebase on crrev.com/c/7064871 once I submit it. Marking this thread unresolved until then.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Rebased on top of crrev.com/c/7064871 and I need your reviews again. Thanks!
// Returns the FocusManager to use when registering accelerators.
virtual views::FocusManager* GetFocusManagerForAccelerator() = 0;
// Returns the reference button for the extension action's popup. Rather than
// relying on the button being a MenuButton, the button returned should have a
// MenuButtonController. This is part of the ongoing work from
// http://crbug.com/901183 to simplify the button hierarchy by migrating
// controller logic into a separate class leaving MenuButton as an empty class
// to be deprecated.
virtual views::BubbleAnchor GetReferenceButtonForPopup(
const extensions::ExtensionId& action_id) = 0;Shuhei TakahashiI should have caught the use of `views::View` here. This CL will depend on comment thread [here](https://chromium-review.googlesource.com/c/chromium/src/+/7064871/comments/35002115_8ecbf796)
Shuhei TakahashiAck. I will put this on hold until we resolve the thread.
Shuhei TakahashiResolved.
Will rebase on crrev.com/c/7064871 once I submit it. Marking this thread unresolved until then.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
extensions: Move ToolbarActionViewDelegateViews methods
This is a part of the patch series to move stateful UI logic from
ExtensionActionViewController to ExtensionActionPlatformDelegate.
This patch moves all methods in ToolbarActionViewDelegateViews to
ExtensionsContainer, namely:
- GetFocusManagerForAccelerator()
- GetReferenceButtonForPopup()
These methods were used only by ExtensionActionPlatformDelegateViews.
Now they call into corresponding methods in ExtensionsContainer
directly.
This ends up leaving no methods in ToolbarActionViewDelegateViews.
This interface will removed in the next patch.
This is a pure refactor. No functional changes are expected.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |