ui: Refactor file dialog handling into BrowserSelectFileDialogController [chromium/src : main]

1 view
Skip to first unread message

Thomas Lukaszewicz (Gerrit)

unread,
May 19, 2026, 1:53:48 AM (13 days ago) May 19
to Nathan, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
Attention needed from Nathan

Thomas Lukaszewicz added 5 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Thomas Lukaszewicz . resolved

Missed a few things in the initial request - left a comment for some nice changes we can bundle into this CL.

Commit Message
Line 14, Patchset 1 (Latest):Bug: none
Thomas Lukaszewicz . unresolved

nit: let's tag the bug `496674143`

File chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
Line 3755, Patchset 1 (Latest): browser()->tab_strip_model()->GetActiveWebContents(),
browser()->window()->GetNativeWindow(),
Thomas Lukaszewicz . unresolved

It looks like all invocations of `BrowserSelectFileDialogController::OpenFile` pass the currently active web contents and the browser's native window.

I think this is a good opportunity to update the `BrowserSelectFileDialogController` constructor to also take a `TabStripModel*`, `ui::BaseWindow*` and `content::PageNavigator*` param, store them as a `raw_ref` and use them when `OpenFile` is called instead of having to pass them to the method each time.

E.g. the constructor would end up looking like
```
BrowserSelectFileDialogController::BrowserSelectFileDialogController(
Profile* profile,
TabStripModel* tab_strip_model,
ui::BaseWindow* base_window,
content::PageNavigator* page_navigator)
: profile_(CHECK_DEREF(profile)),
tab_strip_model_(CHECK_DEREF(tab_strip_model)),
base_window_(CHECK_DEREF(base_window)),
page_navigator_(CHECK_DEREF(page_navigator)) {}
```

Similar to how its done for [`BrowserLiveTabContext`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_live_tab_context.cc;l=93;drc=c165bab1ca702bf8e7f9539808505a2269deea4b).

Note: We might have to move where the `BrowserSelectFileDialog` is currently constructed in `BrowserWindowFeatures::Init()` to `BrowserWindowFeatures::InitPostWindowConstruction()` (so that the `BrowserWindow` is constructed for the `ui::BaseWindow`).

Line 3757, Patchset 1 (Latest): base::BindOnce(&Browser::OnFileSelectedFromDialog,
Thomas Lukaszewicz . resolved

wrt above - for context on why we pass by pointer instead of by reference, see the second last paragraph in the style guide section [here](https://google.github.io/styleguide/cppguide.html#Inputs_and_Outputs).

It's a little controversial but the reason is effectively there's a risk the reference param can unintentionally bind a temporary, which would result in logic and lifetime issues if retained by the callee.

File chrome/browser/ui/browser.h
Line 699, Patchset 1 (Latest): void OnFileSelectedFromDialog(const GURL& url);
Thomas Lukaszewicz . unresolved

I think we can actually remove this, and using the `content::PageNavigator` param in `BrowserSelectFileDialogController` we can directly call `PageNavigator::OpenURL` using the same params as what `Browser` uses (browser call to `OpenURL` below.

```
OpenURL(OpenURLParams(url, Referrer(), WindowOpenDisposition::CURRENT_TAB,
ui::PAGE_TRANSITION_TYPED, false),
/*navigation_handle_callback=*/{});
```
Open in Gerrit

Related details

Attention is currently required from:
  • Nathan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
Gerrit-Change-Number: 7859089
Gerrit-PatchSet: 1
Gerrit-Owner: Nathan <nathan...@gmail.com>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Attention: Nathan <nathan...@gmail.com>
Gerrit-Comment-Date: Tue, 19 May 2026 05:53:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Thomas Lukaszewicz (Gerrit)

unread,
May 24, 2026, 6:12:31 PM (7 days ago) May 24
to Nathan, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
Attention needed from Nathan

Thomas Lukaszewicz added 4 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Thomas Lukaszewicz . resolved

Change looks awesome! Just a few minor nits

File chrome/browser/ui/browser_select_file_dialog_controller.h
Line 33, Patchset 5 (Latest): void OpenFile();
Thomas Lukaszewicz . unresolved

nit: Lets move this declaration below the destructor below (guidance for ordering methods is [here](https://google.github.io/styleguide/cppguide.html#Declaration_Order)).

File chrome/browser/ui/browser_select_file_dialog_controller.cc
Line 91, Patchset 5 (Latest): // to notify anymore. The controller just waits for the next invocation.
Thomas Lukaszewicz . unresolved

nit: We don't need to reset the callback anymore (doesn't exist) but we should keep the `select_file_dialog_.reset();` just to keep behavior as similar as possible to the original implementation.

File chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
Line 40, Patchset 5 (Latest): BrowserSelectFileDialogController::OpenFile()
Thomas Lukaszewicz . unresolved
nit: This probably needs to be
```
browser()
->GetFeatures()
.browser_select_file_dialog_controller()
->OpenFile();
```
Also in addition to building chrome it may help to build the `chrome browser_tests unit_tests` targets since there are often test files that are missed in just a regular chrome compile.
Open in Gerrit

Related details

Attention is currently required from:
  • Nathan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
Gerrit-Change-Number: 7859089
Gerrit-PatchSet: 5
Gerrit-Owner: Nathan <nathan...@gmail.com>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Attention: Nathan <nathan...@gmail.com>
Gerrit-Comment-Date: Sun, 24 May 2026 22:11:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Thomas Lukaszewicz (Gerrit)

unread,
May 26, 2026, 11:06:46 PM (5 days ago) May 26
to Nathan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
Attention needed from Nathan

Thomas Lukaszewicz added 1 comment

File chrome/browser/ui/browser_window/internal/browser_window_features.cc
Line 1174, Patchset 10 (Latest):
if (browser_select_file_dialog_controller_) {
browser_select_file_dialog_controller_->reset();
}
Thomas Lukaszewicz . unresolved

This needs to be `.reset()` so it applies to the `std::unique_ptr`. When you use the `->` operator, the definition of `std::unique_ptr` dereferences the templated type as a pointer and call a method on it.

You can also avoid the if-check since even if the `std::unique_ptr` is empty `.reset()` simply no-ops.

Open in Gerrit

Related details

Attention is currently required from:
  • Nathan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
Gerrit-Change-Number: 7859089
Gerrit-PatchSet: 10
Gerrit-Owner: Nathan <nathan...@gmail.com>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Comment-Date: Wed, 27 May 2026 03:06:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Thomas Lukaszewicz (Gerrit)

unread,
May 27, 2026, 5:11:22 PM (4 days ago) May 27
to Nathan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
Attention needed from Nathan

Thomas Lukaszewicz added 2 comments

File chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
Line 3755, Patchset 11 (Latest): ->->GetFeatures()
Thomas Lukaszewicz . unresolved

nit: only one 1 `->` dereference necessary

File chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
Line 13, Patchset 11 (Latest):#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
Thomas Lukaszewicz . unresolved

nit: It looks like we also need to add the `chrome/browser/ui/browser_select_file_dialog_controller.h` include here (transitive include issue again only on linux 😞).

fyi chrome is trying to do more include-what-you-use to avoid these sorts of issues going forward.

Open in Gerrit

Related details

Attention is currently required from:
  • Nathan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
Gerrit-Change-Number: 7859089
Gerrit-PatchSet: 11
Gerrit-Owner: Nathan <nathan...@gmail.com>
Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
Gerrit-Attention: Nathan <nathan...@gmail.com>
Gerrit-Comment-Date: Wed, 27 May 2026 21:10:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Nathan (Gerrit)

unread,
May 28, 2026, 2:47:48 AM (4 days ago) May 28
to Thomas Lukaszewicz, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
Attention needed from Thomas Lukaszewicz

Nathan added 9 comments

Commit Message
Line 14, Patchset 1:Bug: none
Thomas Lukaszewicz . resolved

nit: let's tag the bug `496674143`

Nathan

Acknowledged

File chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
Line 3755, Patchset 11: ->->GetFeatures()
Thomas Lukaszewicz . resolved

nit: only one 1 `->` dereference necessary

Nathan

Marked as resolved.

Line 3755, Patchset 1: browser()->tab_strip_model()->GetActiveWebContents(),
browser()->window()->GetNativeWindow(),
Thomas Lukaszewicz . resolved

It looks like all invocations of `BrowserSelectFileDialogController::OpenFile` pass the currently active web contents and the browser's native window.

I think this is a good opportunity to update the `BrowserSelectFileDialogController` constructor to also take a `TabStripModel*`, `ui::BaseWindow*` and `content::PageNavigator*` param, store them as a `raw_ref` and use them when `OpenFile` is called instead of having to pass them to the method each time.

E.g. the constructor would end up looking like
```
BrowserSelectFileDialogController::BrowserSelectFileDialogController(
Profile* profile,
TabStripModel* tab_strip_model,
ui::BaseWindow* base_window,
content::PageNavigator* page_navigator)
: profile_(CHECK_DEREF(profile)),
tab_strip_model_(CHECK_DEREF(tab_strip_model)),
base_window_(CHECK_DEREF(base_window)),
page_navigator_(CHECK_DEREF(page_navigator)) {}
```

Similar to how its done for [`BrowserLiveTabContext`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_live_tab_context.cc;l=93;drc=c165bab1ca702bf8e7f9539808505a2269deea4b).

Note: We might have to move where the `BrowserSelectFileDialog` is currently constructed in `BrowserWindowFeatures::Init()` to `BrowserWindowFeatures::InitPostWindowConstruction()` (so that the `BrowserWindow` is constructed for the `ui::BaseWindow`).

Nathan

Acknowledged

File chrome/browser/ui/browser.h
Line 699, Patchset 1: void OnFileSelectedFromDialog(const GURL& url);
Thomas Lukaszewicz . resolved

I think we can actually remove this, and using the `content::PageNavigator` param in `BrowserSelectFileDialogController` we can directly call `PageNavigator::OpenURL` using the same params as what `Browser` uses (browser call to `OpenURL` below.

```
OpenURL(OpenURLParams(url, Referrer(), WindowOpenDisposition::CURRENT_TAB,
ui::PAGE_TRANSITION_TYPED, false),
/*navigation_handle_callback=*/{});
```
Nathan

Acknowledged

File chrome/browser/ui/browser_select_file_dialog_controller.h
Line 33, Patchset 5: void OpenFile();
Thomas Lukaszewicz . resolved

nit: Lets move this declaration below the destructor below (guidance for ordering methods is [here](https://google.github.io/styleguide/cppguide.html#Declaration_Order)).

Nathan

Acknowledged

File chrome/browser/ui/browser_select_file_dialog_controller.cc
Line 91, Patchset 5: // to notify anymore. The controller just waits for the next invocation.
Thomas Lukaszewicz . resolved

nit: We don't need to reset the callback anymore (doesn't exist) but we should keep the `select_file_dialog_.reset();` just to keep behavior as similar as possible to the original implementation.

Nathan

Acknowledged

File chrome/browser/ui/browser_window/internal/browser_window_features.cc
Line 1174, Patchset 10:
if (browser_select_file_dialog_controller_) {
browser_select_file_dialog_controller_->reset();
}
Thomas Lukaszewicz . resolved

This needs to be `.reset()` so it applies to the `std::unique_ptr`. When you use the `->` operator, the definition of `std::unique_ptr` dereferences the templated type as a pointer and call a method on it.

You can also avoid the if-check since even if the `std::unique_ptr` is empty `.reset()` simply no-ops.

Nathan

Done

File chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
Line 13, Patchset 11:#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
Thomas Lukaszewicz . resolved

nit: It looks like we also need to add the `chrome/browser/ui/browser_select_file_dialog_controller.h` include here (transitive include issue again only on linux 😞).

fyi chrome is trying to do more include-what-you-use to avoid these sorts of issues going forward.

Nathan

Done

Line 40, Patchset 5: BrowserSelectFileDialogController::OpenFile()
Thomas Lukaszewicz . resolved
nit: This probably needs to be
```
browser()
->GetFeatures()
.browser_select_file_dialog_controller()
->OpenFile();
```
Also in addition to building chrome it may help to build the `chrome browser_tests unit_tests` targets since there are often test files that are missed in just a regular chrome compile.
Nathan

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Thomas Lukaszewicz
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
    Gerrit-Change-Number: 7859089
    Gerrit-PatchSet: 13
    Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
    Gerrit-Comment-Date: Thu, 28 May 2026 06:47:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Thomas Lukaszewicz <tl...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Thomas Lukaszewicz (Gerrit)

    unread,
    May 28, 2026, 4:08:35 AM (4 days ago) May 28
    to Nathan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
    Attention needed from Nathan

    Thomas Lukaszewicz added 5 comments

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Thomas Lukaszewicz . resolved

    Looks great! Seems like the bots will pass, at this point just a few remaining nits

    File chrome/browser/ui/browser.h
    Line 608, Patchset 13 (Latest): // Whether the specified WebContents can be saved.
    // Saving can be disabled e.g. for the DevTools window.
    bool CanSaveContents(content::WebContents* web_contents) const;
    Thomas Lukaszewicz . unresolved

    nit: It looks like we should be able to remove this (I don't see it used anywhere, perhaps an artifact from a previous patchset).

    File chrome/browser/ui/browser_command_controller.cc
    Line 59, Patchset 13 (Latest):#include "chrome/browser/ui/browser_finder.h"
    Thomas Lukaszewicz . unresolved

    nit: We can drop this include (doesn't look necessary - and hopefully completely deprecated now!)

    File chrome/browser/ui/browser_select_file_dialog_controller.cc
    Line 14, Patchset 13 (Latest):#include "chrome/browser/ui/browser_window.h"
    Thomas Lukaszewicz . unresolved

    nit: We should be able to replace this with the `ui::BaseWindow` include `#include ui/base/base_window.h`

    Line 17, Patchset 13 (Latest):#include "content/public/browser/web_contents.h"
    Thomas Lukaszewicz . unresolved

    nit: We should add `content/public/browser/page_navigator.h` for iwyu also

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Nathan
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
      Gerrit-Change-Number: 7859089
      Gerrit-PatchSet: 13
      Gerrit-Owner: Nathan <nathan...@gmail.com>
      Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
      Gerrit-Attention: Nathan <nathan...@gmail.com>
      Gerrit-Comment-Date: Thu, 28 May 2026 08:08:13 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Nathan (Gerrit)

      unread,
      May 28, 2026, 6:45:49 AM (4 days ago) May 28
      to Thomas Lukaszewicz, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
      Attention needed from Thomas Lukaszewicz

      Nathan added 6 comments

      File chrome/browser/ui/browser.h
      Line 608, Patchset 13: // Whether the specified WebContents can be saved.

      // Saving can be disabled e.g. for the DevTools window.
      bool CanSaveContents(content::WebContents* web_contents) const;
      Thomas Lukaszewicz . resolved

      nit: It looks like we should be able to remove this (I don't see it used anywhere, perhaps an artifact from a previous patchset).

      Nathan

      Done

      File chrome/browser/ui/browser_command_controller.cc
      Line 59, Patchset 13:#include "chrome/browser/ui/browser_finder.h"
      Thomas Lukaszewicz . resolved

      nit: We can drop this include (doesn't look necessary - and hopefully completely deprecated now!)

      Nathan

      Done

      File chrome/browser/ui/browser_select_file_dialog_controller.cc
      Line 14, Patchset 13:#include "chrome/browser/ui/browser_window.h"
      Thomas Lukaszewicz . resolved

      nit: We should be able to replace this with the `ui::BaseWindow` include `#include ui/base/base_window.h`

      Nathan

      Done

      Line 14, Patchset 13:#include "chrome/browser/ui/browser_window.h"
      Thomas Lukaszewicz . resolved

      nit: We should be able to replace this with the `ui::BaseWindow` include `#include ui/base/base_window.h`

      Nathan

      Done

      Line 17, Patchset 13:#include "content/public/browser/web_contents.h"
      Thomas Lukaszewicz . resolved

      nit: We should add `content/public/browser/page_navigator.h` for iwyu also

      Nathan

      Done

      Line 17, Patchset 13:#include "content/public/browser/web_contents.h"
      Thomas Lukaszewicz . resolved

      nit: We should add `content/public/browser/page_navigator.h` for iwyu also

      Nathan

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Thomas Lukaszewicz
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
        Gerrit-Change-Number: 7859089
        Gerrit-PatchSet: 15
        Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
        Gerrit-Comment-Date: Thu, 28 May 2026 10:45:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Thomas Lukaszewicz <tl...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Thomas Lukaszewicz (Gerrit)

        unread,
        May 28, 2026, 2:29:45 PM (3 days ago) May 28
        to Nathan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
        Attention needed from Nathan

        Thomas Lukaszewicz added 3 comments

        File chrome/browser/ui/browser.cc
        Line 1354, Patchset 15 (Latest):bool Browser::CanSaveContents(content::WebContents* web_contents) const {
        return chrome::CanSavePage(this);
        }
        Thomas Lukaszewicz . unresolved

        nit: We can remove this impl also

        File chrome/browser/ui/browser_select_file_dialog_controller.h
        Line 40, Patchset 15 (Latest): void OpenFile();
        Thomas Lukaszewicz . unresolved

        nit: Let's add a comment
        ```
        // Opens a file selection dialog for the browser's currently active tab.
        ```

        File chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
        Line 41, Patchset 15 (Latest): void ShowUi(const std::string& /* name */) override {
        Thomas Lukaszewicz . unresolved

        You can just leave this as `const std::string& name` (we typically just keep the param name even if unused by convention).

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Nathan
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
          Gerrit-Change-Number: 7859089
          Gerrit-PatchSet: 15
          Gerrit-Owner: Nathan <nathan...@gmail.com>
          Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
          Gerrit-Attention: Nathan <nathan...@gmail.com>
          Gerrit-Comment-Date: Thu, 28 May 2026 18:29:13 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Nathan (Gerrit)

          unread,
          May 29, 2026, 4:42:28 AM (3 days ago) May 29
          to Thomas Lukaszewicz, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
          Attention needed from Thomas Lukaszewicz

          Nathan added 3 comments

          File chrome/browser/ui/browser.cc
          Line 1354, Patchset 15 (Latest):bool Browser::CanSaveContents(content::WebContents* web_contents) const {
          return chrome::CanSavePage(this);
          }
          Thomas Lukaszewicz . resolved

          nit: We can remove this impl also

          Nathan

          Done

          File chrome/browser/ui/browser_select_file_dialog_controller.h
          Thomas Lukaszewicz . resolved

          nit: Let's add a comment
          ```
          // Opens a file selection dialog for the browser's currently active tab.
          ```

          Nathan

          Done

          File chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
          Line 41, Patchset 15 (Latest): void ShowUi(const std::string& /* name */) override {
          Thomas Lukaszewicz . resolved

          You can just leave this as `const std::string& name` (we typically just keep the param name even if unused by convention).

          Nathan

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Thomas Lukaszewicz
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
            Gerrit-Change-Number: 7859089
            Gerrit-PatchSet: 15
            Gerrit-Owner: Nathan <nathan...@gmail.com>
            Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Attention: Thomas Lukaszewicz <tl...@chromium.org>
            Gerrit-Comment-Date: Fri, 29 May 2026 08:42:03 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Thomas Lukaszewicz <tl...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Thomas Lukaszewicz (Gerrit)

            unread,
            May 31, 2026, 2:40:17 PM (10 hours ago) May 31
            to Nathan, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
            Attention needed from Nathan

            Thomas Lukaszewicz voted and added 2 comments

            Votes added by Thomas Lukaszewicz

            Code-Review+1

            2 comments

            Patchset-level comments
            File-level comment, Patchset 16 (Latest):
            Thomas Lukaszewicz . resolved

            lgtm!

            File chrome/browser/ui/browser_command_controller.cc
            Line 59, Patchset 16 (Latest):#include "chrome/browser/ui/browser_finder.h"
            Thomas Lukaszewicz . unresolved

            Probably due to another ToT change breaking a transitive include -_-.

            Tested locally and adding
            ```
            #include "chrome/browser/ui/browser_select_file_dialog_controller.h"
            ```

            fixes the build.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Nathan
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
              Gerrit-Change-Number: 7859089
              Gerrit-PatchSet: 16
              Gerrit-Attention: Nathan <nathan...@gmail.com>
              Gerrit-Comment-Date: Sun, 31 May 2026 18:39:43 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Nathan (Gerrit)

              unread,
              May 31, 2026, 6:32:58 PM (6 hours ago) May 31
              to Thomas Lukaszewicz, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org

              Nathan added 1 comment

              File chrome/browser/ui/browser_command_controller.cc
              Line 59, Patchset 16 (Latest):#include "chrome/browser/ui/browser_finder.h"
              Thomas Lukaszewicz . resolved

              Probably due to another ToT change breaking a transitive include -_-.

              Tested locally and adding
              ```
              #include "chrome/browser/ui/browser_select_file_dialog_controller.h"
              ```

              fixes the build.

              Nathan

              Done

              Open in Gerrit

              Related details

              Attention set is empty
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
                Gerrit-Change-Number: 7859089
                Gerrit-PatchSet: 16
                Gerrit-Owner: Nathan <nathan...@gmail.com>
                Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
                Gerrit-Comment-Date: Sun, 31 May 2026 22:32:23 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Thomas Lukaszewicz (Gerrit)

                unread,
                May 31, 2026, 6:58:43 PM (6 hours ago) May 31
                to Nathan, Hidehiko Abe, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
                Attention needed from Hidehiko Abe and Nathan

                Thomas Lukaszewicz voted and added 1 comment

                Votes added by Thomas Lukaszewicz

                Code-Review+1

                1 comment

                Patchset-level comments
                File-level comment, Patchset 17 (Latest):
                Thomas Lukaszewicz . resolved

                Hidehiko ptal for chromeos

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Hidehiko Abe
                • Nathan
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
                Gerrit-Change-Number: 7859089
                Gerrit-PatchSet: 17
                Gerrit-Owner: Nathan <nathan...@gmail.com>
                Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
                Gerrit-Attention: Nathan <nathan...@gmail.com>
                Gerrit-Attention: Hidehiko Abe <hide...@chromium.org>
                Gerrit-Comment-Date: Sun, 31 May 2026 22:58:09 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Hidehiko Abe (Gerrit)

                unread,
                May 31, 2026, 10:37:31 PM (2 hours ago) May 31
                to Nathan, Thomas Lukaszewicz, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
                Attention needed from Nathan

                Hidehiko Abe voted and added 1 comment

                Votes added by Hidehiko Abe

                Code-Review+1

                1 comment

                Patchset-level comments
                Hidehiko Abe . resolved

                c/b/ash LGTM

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Nathan
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
                Gerrit-Change-Number: 7859089
                Gerrit-PatchSet: 17
                Gerrit-Owner: Nathan <nathan...@gmail.com>
                Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
                Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
                Gerrit-Attention: Nathan <nathan...@gmail.com>
                Gerrit-Comment-Date: Mon, 01 Jun 2026 02:37:06 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                open
                diffy

                Thomas Lukaszewicz (Gerrit)

                unread,
                May 31, 2026, 10:41:15 PM (2 hours ago) May 31
                to Nathan, Hidehiko Abe, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org
                Attention needed from Nathan

                Thomas Lukaszewicz voted Commit-Queue+2

                Commit-Queue+2
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Nathan
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
                Gerrit-Change-Number: 7859089
                Gerrit-PatchSet: 17
                Gerrit-Owner: Nathan <nathan...@gmail.com>
                Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
                Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
                Gerrit-Attention: Nathan <nathan...@gmail.com>
                Gerrit-Comment-Date: Mon, 01 Jun 2026 02:40:47 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                open
                diffy

                Chromium LUCI CQ (Gerrit)

                unread,
                May 31, 2026, 11:41:18 PM (1 hour ago) May 31
                to Nathan, Hidehiko Abe, Thomas Lukaszewicz, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, filesapp...@chromium.org, rginda...@chromium.org

                Chromium LUCI CQ submitted the change

                Change information

                Commit message:
                ui: Refactor file dialog handling into BrowserSelectFileDialogController

                Decouple the file dialog initialization and event handling logic out of
                the monolithic Browser class and into a dedicated UI feature controller.
                This simplifies Browser and prepares it for cleaner dependency injection
                and localized test management.
                Bug: 496674143
                Change-Id: I7b656d83356324bc228336434069f54222e03acc
                Reviewed-by: Hidehiko Abe <hide...@chromium.org>
                Reviewed-by: Thomas Lukaszewicz <tl...@chromium.org>
                Commit-Queue: Thomas Lukaszewicz <tl...@chromium.org>
                Cr-Commit-Position: refs/heads/main@{#1639149}
                Files:
                • M AUTHORS
                • M chrome/browser/ash/file_manager/DEPS
                • M chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
                • M chrome/browser/ui/browser.cc
                • M chrome/browser/ui/browser.h
                • M chrome/browser/ui/browser_command_controller.cc
                • M chrome/browser/ui/browser_select_file_dialog_controller.cc
                • M chrome/browser/ui/browser_select_file_dialog_controller.h
                • M chrome/browser/ui/browser_window/internal/browser_window_features.cc
                • M chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
                • M chrome/browser/ui/views/select_file_dialog_extension/select_file_dialog_extension_browsertest.cc
                Change size: M
                Delta: 11 files changed, 70 insertions(+), 57 deletions(-)
                Branch: refs/heads/main
                Submit Requirements:
                • requirement satisfiedCode-Review: +1 by Thomas Lukaszewicz, +1 by Hidehiko Abe
                Open in Gerrit
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: merged
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I7b656d83356324bc228336434069f54222e03acc
                Gerrit-Change-Number: 7859089
                Gerrit-PatchSet: 18
                Gerrit-Owner: Nathan <nathan...@gmail.com>
                Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                Gerrit-Reviewer: Hidehiko Abe <hide...@chromium.org>
                Gerrit-Reviewer: Thomas Lukaszewicz <tl...@chromium.org>
                open
                diffy
                satisfied_requirement
                Reply all
                Reply to author
                Forward
                0 new messages