Commit-Queue | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
BrowserDelegate* GetDelegate(BrowserWindowInterface* bwi) override;
To fix ChromeOS it looks like we need to update the virtual method [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/browser_delegate/browser_controller.h;l=84;drc=4128411589187a396829a827f59a655bed876aa7)
GetAllBrowserWindowInterfaces()) {
I think in general we should move away from using this method and towards
[`ForEachCurrentBrowserWindowInterfaceOrderedByActivation()`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_window/public/browser_window_interface_iterator.h;l=40;drc=46e9f2e7d765e84a77f330301a6eb6233de84d0d) which is the safe way to iterate over the BWIs.
I'll mark this as deprecated in a separate change.
#include "chrome/browser/ui/browser_window/public/browser_window_interface_iterator.h"
To fix the android compile failures you might need to append `nogncheck` to this include also.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
Thanks for the review, addressed the comments.
BrowserDelegate* GetDelegate(BrowserWindowInterface* bwi) override;
To fix ChromeOS it looks like we need to update the virtual method [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/browser_delegate/browser_controller.h;l=84;drc=4128411589187a396829a827f59a655bed876aa7)
Done
GetAllBrowserWindowInterfaces()) {
I think in general we should move away from using this method and towards
[`ForEachCurrentBrowserWindowInterfaceOrderedByActivation()`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_window/public/browser_window_interface_iterator.h;l=40;drc=46e9f2e7d765e84a77f330301a6eb6233de84d0d) which is the safe way to iterate over the BWIs.I'll mark this as deprecated in a separate change.
Thanks for the tip, I changed it to use the other function.
#include "chrome/browser/ui/browser_window/public/browser_window_interface_iterator.h"
To fix the android compile failures you might need to append `nogncheck` to this include also.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Looks good! Added some nits.
.insert({bwi, std::make_unique<BrowserDelegateImpl>(
bwi->GetBrowserForMigrationOnly())})
(Not related to your PR), consider using `emplace`:
```cpp
.emplace(bwi, std::make_unique<BrowserDelegateImpl>(
bwi->GetBrowserForMigrationOnly()))
```
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" // nogncheck
Consider logging a bug to fix this later and add a TODO comment here.
BrowserWindowInterface* const bwi =
Consider rename to `last_active_bwi`.
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" // nogncheck
Consider logging a bug to fix this nogncheck and added a TODO comment with the bug number.
BrowserWindowInterface* const bwi =
Consider rename to `active_bwi`.
old_z_order_level_ = bwi_->GetWindow()->GetZOrderLevel();
Consider using `bwi` directly instead of the `WeakPtr` deref. Same comment for the next line.
BrowserWindowInterface* const bwi =
Consider rename to `last_active_bwi`.
if (auto* const bwi = GetLastActiveBrowserWindowInterfaceWithAnyProfile()) {
Consider renaming to `last_active_bwi`.
BrowserWindowInterface* const bwi =
Consider renaming to `last_active_bwi`.
BrowserWindowInterface* const bwi =
Consider renaming to `last_active_bwi`.
const auto* const bwi = GetLastActiveBrowserWindowInterfaceWithAnyProfile();
Consider renaming to `last_active_bwi`.
#include "chrome/browser/ui/browser_window/public/browser_window_interface_iterator.h" // nogncheck
Consider logging a bug and adding a TODO item.
new_last_active->GetBrowserForMigrationOnly());
nit: Consider caching the `Browser*` out of the for loop and using it here.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Still lgtm, I'll re-stamp after comments are resolved (since the update will reset votes)
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" // nogncheck
Consider logging a bug to fix this later and add a TODO comment here.
If you wanted to tag a bug feel free to use crbug.com/40147906
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
Thanks for the review, resolved the comments.
.insert({bwi, std::make_unique<BrowserDelegateImpl>(
bwi->GetBrowserForMigrationOnly())})
(Not related to your PR), consider using `emplace`:
```cpp
.emplace(bwi, std::make_unique<BrowserDelegateImpl>(
bwi->GetBrowserForMigrationOnly()))
```
Done
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" // nogncheck
Tom LukaszewiczConsider logging a bug to fix this later and add a TODO comment here.
If you wanted to tag a bug feel free to use crbug.com/40147906
I saw some other refs to that crbug just add the link after the nogncheck so I followed that example.
Consider rename to `last_active_bwi`.
Done
#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" // nogncheck
Consider logging a bug to fix this nogncheck and added a TODO comment with the bug number.
Done
Consider rename to `active_bwi`.
Done
old_z_order_level_ = bwi_->GetWindow()->GetZOrderLevel();
Consider using `bwi` directly instead of the `WeakPtr` deref. Same comment for the next line.
Done
Consider rename to `last_active_bwi`.
Done
if (auto* const bwi = GetLastActiveBrowserWindowInterfaceWithAnyProfile()) {
Consider renaming to `last_active_bwi`.
Done
Consider renaming to `last_active_bwi`.
Done
Consider renaming to `last_active_bwi`.
Done
const auto* const bwi = GetLastActiveBrowserWindowInterfaceWithAnyProfile();
Consider renaming to `last_active_bwi`.
Done
#include "chrome/browser/ui/browser_window/public/browser_window_interface_iterator.h" // nogncheck
Consider logging a bug and adding a TODO item.
Done
new_last_active->GetBrowserForMigrationOnly());
nit: Consider caching the `Browser*` out of the for loop and using it here.
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. |
Code-Review | +1 |
lgtm! Thanks for the cleanup!
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +0 |
@khorimoto - Please review remaining ash/chromeos files, thanks!
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. |
Reassigning to @ne...@chromium.org to take a look at the DEPS changes. I'm not working on this anymore, but I don't think we want to add new browser.h dependencies.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Reassigning to @ne...@chromium.org to take a look at the DEPS changes. I'm not working on this anymore, but I don't think we want to add new browser.h dependencies.
The related files were already handling Browser pointers and passing them into calls to other functions, but they didn't need the browser.h include.
However, once I changed some functions to take a BrowserWindowInterface instead of Browser, now those files need the browser.h include to be aware that Browser inherits from BWI.
Alex CarutasuReassigning to @ne...@chromium.org to take a look at the DEPS changes. I'm not working on this anymore, but I don't think we want to add new browser.h dependencies.
The related files were already handling Browser pointers and passing them into calls to other functions, but they didn't need the browser.h include.
However, once I changed some functions to take a BrowserWindowInterface instead of Browser, now those files need the browser.h include to be aware that Browser inherits from BWI.
For reference the file that needs the Browser include is:
chrome/browser/ash/file_system_provider/operation_request_manager.cc
around line 78 we are passing the browser into a call to retrieve a BrowserDelegate.
However, I don't see any usage off of the browser object explicitly. I believe we can forward declare at the top of the cc file removing the need for the include 👍
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Alex CarutasuReassigning to @ne...@chromium.org to take a look at the DEPS changes. I'm not working on this anymore, but I don't think we want to add new browser.h dependencies.
Darryl JamesThe related files were already handling Browser pointers and passing them into calls to other functions, but they didn't need the browser.h include.
However, once I changed some functions to take a BrowserWindowInterface instead of Browser, now those files need the browser.h include to be aware that Browser inherits from BWI.
For reference the file that needs the Browser include is:
chrome/browser/ash/file_system_provider/operation_request_manager.ccaround line 78 we are passing the browser into a call to retrieve a BrowserDelegate.
However, I don't see any usage off of the browser object explicitly. I believe we can forward declare at the top of the cc file removing the need for the include 👍
A browser pointer is passed into a call to `BrowserController::GetDelegate()` in that file, which I modified to take a BWI pointer.
Without the include, `operation_request_manager.cc` is not aware that Browser inherits from BWI and that generates a build break.
Alex CarutasuReassigning to @ne...@chromium.org to take a look at the DEPS changes. I'm not working on this anymore, but I don't think we want to add new browser.h dependencies.
Darryl JamesThe related files were already handling Browser pointers and passing them into calls to other functions, but they didn't need the browser.h include.
However, once I changed some functions to take a BrowserWindowInterface instead of Browser, now those files need the browser.h include to be aware that Browser inherits from BWI.
Alex CarutasuFor reference the file that needs the Browser include is:
chrome/browser/ash/file_system_provider/operation_request_manager.ccaround line 78 we are passing the browser into a call to retrieve a BrowserDelegate.
However, I don't see any usage off of the browser object explicitly. I believe we can forward declare at the top of the cc file removing the need for the include 👍
A browser pointer is passed into a call to `BrowserController::GetDelegate()` in that file, which I modified to take a BWI pointer.
Without the include, `operation_request_manager.cc` is not aware that Browser inherits from BWI and that generates a build break.
Ahh got it - thanks for reminding me!
In that case can we use `WindowController::GetBrowserWindowInterface()` instead?
Commit-Queue | +1 |
Alex CarutasuReassigning to @ne...@chromium.org to take a look at the DEPS changes. I'm not working on this anymore, but I don't think we want to add new browser.h dependencies.
Darryl JamesThe related files were already handling Browser pointers and passing them into calls to other functions, but they didn't need the browser.h include.
However, once I changed some functions to take a BrowserWindowInterface instead of Browser, now those files need the browser.h include to be aware that Browser inherits from BWI.
Alex CarutasuFor reference the file that needs the Browser include is:
chrome/browser/ash/file_system_provider/operation_request_manager.ccaround line 78 we are passing the browser into a call to retrieve a BrowserDelegate.
However, I don't see any usage off of the browser object explicitly. I believe we can forward declare at the top of the cc file removing the need for the include 👍
Darryl JamesA browser pointer is passed into a call to `BrowserController::GetDelegate()` in that file, which I modified to take a BWI pointer.
Without the include, `operation_request_manager.cc` is not aware that Browser inherits from BWI and that generates a build break.
Ahh got it - thanks for reminding me!
In that case can we use `WindowController::GetBrowserWindowInterface()` instead?
Thanks for the tip, wasn't aware of that alternative.
Trying it out.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Code-Review | +1 |
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. |
Code-Review | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[bedrock] Remove remaining BrowserList::GetLastActive() calls from product code
This CL migrates the remaining product code (non-test) callsites of
BrowserList::GetLastActive() to
GetLastActiveBrowserWindowInterfaceWithAnyProfile().
Notes:
- Refactored related utilities where necessary and possible to use
BrowserWindowInterface over Browser to support migrating the
GetLastActive() callsites.
- Used GetBrowserForMigrationOnly() in a few spots where refactoring the
related code to use BrowserWindowInterface was non-trivial.
- Added a couple GN and DEPS file exceptions to enable using
browser_window_interface*.h includes.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |