Integrate --focus flag to focus existing browser content [chromium/src : main]

0 views
Skip to first unread message

Helmut Januschka (Gerrit)

unread,
Sep 24, 2025, 3:08:35 PMSep 24
to Helmut Januschka, Mirko Bonadei, Jerome Jiang, Kaan Alsan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Kaan Alsan

Helmut Januschka added 2 comments

File chrome/browser/ui/startup/startup_browser_creator.cc
Line 69, Patchset 35:#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/startup/focus/focus_handler.h"
#endif
Kaan Alsan . resolved

style: avoid putting conditional includes inside the main blocks. This can be moved to line 150

Helmut Januschka

Done

Line 1040, Patchset 35: if (focus_result.status == focus::FocusStatus::kFocused ||
Kaan Alsan . resolved

can you please add a comment explaining the intended behavior here? e.g., why do we early-return if there's no match and no command line args?

Helmut Januschka

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Kaan Alsan
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
Gerrit-Change-Number: 6943437
Gerrit-PatchSet: 41
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
Gerrit-CC: Jerome Jiang <ji...@chromium.org>
Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
Gerrit-Attention: Kaan Alsan <al...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Sep 2025 19:08:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kaan Alsan (Gerrit)

unread,
Sep 24, 2025, 5:51:36 PMSep 24
to Helmut Januschka, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
Attention needed from Helmut Januschka

Kaan Alsan voted and added 1 comment

Votes added by Kaan Alsan

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 42 (Latest):
Kaan Alsan . resolved

LGTM! I'll comment here once we get launch approval.

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
    Gerrit-Change-Number: 6943437
    Gerrit-PatchSet: 42
    Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
    Gerrit-CC: Jerome Jiang <ji...@chromium.org>
    Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
    Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 21:51:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Helmut Januschka (Gerrit)

    unread,
    Sep 30, 2025, 4:43:21 PM (11 days ago) Sep 30
    to Helmut Januschka, Kaan Alsan, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
    Attention needed from Kaan Alsan

    Helmut Januschka added 1 comment

    Patchset-level comments
    File-level comment, Patchset 45 (Latest):
    Helmut Januschka . resolved

    @al...@chromium.org
    during review, there where some changes added, so this will require a re-review.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kaan Alsan
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
      Gerrit-Change-Number: 6943437
      Gerrit-PatchSet: 45
      Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
      Gerrit-CC: Jerome Jiang <ji...@chromium.org>
      Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
      Gerrit-Attention: Kaan Alsan <al...@chromium.org>
      Gerrit-Comment-Date: Tue, 30 Sep 2025 20:43:04 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kaan Alsan (Gerrit)

      unread,
      Oct 6, 2025, 1:39:02 PM (6 days ago) Oct 6
      to Helmut Januschka, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
      Attention needed from Helmut Januschka

      Kaan Alsan added 1 comment

      Patchset-level comments
      File-level comment, Patchset 29:
      Kaan Alsan . unresolved

      This feature is currently undergoing a formal launch review (http://launch/4425960, for internal folks).

      Please hold off on submitting this until the launch is approved (I'll let you know when!)

      Kaan Alsan

      FYI, I'll be OOO from Sep 25th to Oct 5th. I'll try to keep the launch review moving and will provide updates as needed, but won't be active for CL reviews.

      Kaan Alsan

      We got security and privacy approval. One more approval needed and then I'll +1 this again.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Helmut Januschka
      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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
        Gerrit-Change-Number: 6943437
        Gerrit-PatchSet: 45
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
        Gerrit-CC: Jerome Jiang <ji...@chromium.org>
        Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
        Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
        Gerrit-Comment-Date: Mon, 06 Oct 2025 17:38:55 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Helmut Januschka (Gerrit)

        unread,
        Oct 10, 2025, 5:13:17 AM (2 days ago) Oct 10
        to Helmut Januschka, Kaan Alsan, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
        Attention needed from Kaan Alsan

        Helmut Januschka added 1 comment

        Patchset-level comments
        Kaan Alsan . unresolved

        This feature is currently undergoing a formal launch review (http://launch/4425960, for internal folks).

        Please hold off on submitting this until the launch is approved (I'll let you know when!)

        Kaan Alsan

        FYI, I'll be OOO from Sep 25th to Oct 5th. I'll try to keep the launch review moving and will provide updates as needed, but won't be active for CL reviews.

        Kaan Alsan

        We got security and privacy approval. One more approval needed and then I'll +1 this again.

        Helmut Januschka

        anything i can do from my side?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kaan Alsan
        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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
        Gerrit-Change-Number: 6943437
        Gerrit-PatchSet: 45
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
        Gerrit-CC: Jerome Jiang <ji...@chromium.org>
        Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
        Gerrit-Attention: Kaan Alsan <al...@chromium.org>
        Gerrit-Comment-Date: Fri, 10 Oct 2025 09:12:32 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Kaan Alsan (Gerrit)

        unread,
        Oct 10, 2025, 8:55:40 AM (2 days ago) Oct 10
        to Helmut Januschka, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
        Attention needed from Helmut Januschka

        Kaan Alsan added 1 comment

        Patchset-level comments

        This feature is currently undergoing a formal launch review (http://launch/4425960, for internal folks).

        Please hold off on submitting this until the launch is approved (I'll let you know when!)

        Kaan Alsan

        FYI, I'll be OOO from Sep 25th to Oct 5th. I'll try to keep the launch review moving and will provide updates as needed, but won't be active for CL reviews.

        Kaan Alsan

        We got security and privacy approval. One more approval needed and then I'll +1 this again.

        Helmut Januschka

        anything i can do from my side?

        Kaan Alsan

        The last approval came in last night, so we are good to launch!

        I'll do another pass over this CL and give the +1 shortly

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Helmut Januschka
        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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
          Gerrit-Change-Number: 6943437
          Gerrit-PatchSet: 45
          Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
          Gerrit-CC: Jerome Jiang <ji...@chromium.org>
          Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
          Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
          Gerrit-Comment-Date: Fri, 10 Oct 2025 12:55:35 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
          Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Kaan Alsan (Gerrit)

          unread,
          Oct 10, 2025, 9:05:01 AM (2 days ago) Oct 10
          to Helmut Januschka, Daniel Murphy, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
          Attention needed from Daniel Murphy and Helmut Januschka

          Kaan Alsan voted and added 5 comments

          Votes added by Kaan Alsan

          Code-Review+1

          5 comments

          Patchset-level comments
          File-level comment, Patchset 45 (Latest):
          Kaan Alsan . resolved

          + @dmu...@chromium.org to review WebAppRegistrar usage in focus_handler.cc

          File chrome/browser/ui/startup/focus/focus_handler.cc
          Line 64, Patchset 45 (Latest): // Get the WebAppProvider to access the registrar for app matching
          Kaan Alsan . unresolved

          style: comment should end with punctuation

          Line 65, Patchset 45 (Latest): web_app::WebAppProvider* provider =
          web_app::WebAppProvider::GetForWebApps(&profile);
          web_app::WebAppRegistrar* registrar =
          provider ? &provider->registrar_unsafe() : nullptr;
          Kaan Alsan . unresolved

          I'm not familiar enough with this code to be sure if this is the correct usage. Adding @dmu...@chromium.org to review this section.

          File chrome/browser/ui/startup/focus/match_candidate.cc
          Line 103, Patchset 45 (Latest): // between apps and regular tabs with similar URLs
          Kaan Alsan . unresolved

          style: comments should have a period at the end. Same for other comments below.

          Line 106, Patchset 45 (Latest): web_app::AppBrowserController* app_controller =
          browser_window.GetAppBrowserController();
          if (app_controller) {
          const webapps::AppId& browser_app_id = app_controller->app_id();
          const web_app::WebApp* web_app = registrar->GetAppById(browser_app_id);
          if (web_app) {
          const webapps::ManifestId& manifest_id = web_app->manifest_id();
          GURL canonicalized_manifest_id = CanonicalizeUrl(manifest_id);

          if (selector.type == SelectorType::kUrlExact) {
          is_match = (canonicalized_manifest_id == canonicalized_selector_url);
          } else if (selector.type == SelectorType::kUrlPrefix) {
          std::string manifest_id_string = canonicalized_manifest_id.spec();
          std::string selector_url_string = canonicalized_selector_url.spec();
          is_match = base::StartsWith(manifest_id_string, selector_url_string,
          base::CompareCase::SENSITIVE);
          }

          if (is_match) {
          matched_app_id = manifest_id.spec();
          }
          }
          }
          // For app windows, return early - don't match by tab URL
          if (!is_match) {
          return std::nullopt;
          }
          Kaan Alsan . unresolved

          this logic is sufficiently complex that a helper function would be beneficial here.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Daniel Murphy
          • Helmut Januschka
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • 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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
            Gerrit-Change-Number: 6943437
            Gerrit-PatchSet: 45
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
            Gerrit-CC: Jerome Jiang <ji...@chromium.org>
            Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
            Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
            Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Comment-Date: Fri, 10 Oct 2025 13:04:51 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Helmut Januschka (Gerrit)

            unread,
            Oct 10, 2025, 10:05:04 AM (2 days ago) Oct 10
            to Helmut Januschka, Daniel Murphy, Kaan Alsan, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
            Attention needed from Daniel Murphy

            Helmut Januschka added 3 comments

            File chrome/browser/ui/startup/focus/focus_handler.cc
            Line 64, Patchset 45: // Get the WebAppProvider to access the registrar for app matching
            Kaan Alsan . resolved

            style: comment should end with punctuation

            Helmut Januschka

            Done

            File chrome/browser/ui/startup/focus/match_candidate.cc
            Line 103, Patchset 45: // between apps and regular tabs with similar URLs
            Kaan Alsan . resolved

            style: comments should have a period at the end. Same for other comments below.

            Helmut Januschka

            Done

            Line 106, Patchset 45: web_app::AppBrowserController* app_controller =

            browser_window.GetAppBrowserController();
            if (app_controller) {
            const webapps::AppId& browser_app_id = app_controller->app_id();
            const web_app::WebApp* web_app = registrar->GetAppById(browser_app_id);
            if (web_app) {
            const webapps::ManifestId& manifest_id = web_app->manifest_id();
            GURL canonicalized_manifest_id = CanonicalizeUrl(manifest_id);

            if (selector.type == SelectorType::kUrlExact) {
            is_match = (canonicalized_manifest_id == canonicalized_selector_url);
            } else if (selector.type == SelectorType::kUrlPrefix) {
            std::string manifest_id_string = canonicalized_manifest_id.spec();
            std::string selector_url_string = canonicalized_selector_url.spec();
            is_match = base::StartsWith(manifest_id_string, selector_url_string,
            base::CompareCase::SENSITIVE);
            }

            if (is_match) {
            matched_app_id = manifest_id.spec();
            }
            }
            }
            // For app windows, return early - don't match by tab URL
            if (!is_match) {
            return std::nullopt;
            }
            Kaan Alsan . resolved

            this logic is sufficiently complex that a helper function would be beneficial here.

            Helmut Januschka

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Daniel Murphy
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • 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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
            Gerrit-Change-Number: 6943437
            Gerrit-PatchSet: 46
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
            Gerrit-CC: Jerome Jiang <ji...@chromium.org>
            Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
            Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Comment-Date: Fri, 10 Oct 2025 14:04:04 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Kaan Alsan (Gerrit)

            unread,
            Oct 10, 2025, 10:08:02 AM (2 days ago) Oct 10
            to Helmut Januschka, Daniel Murphy, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
            Attention needed from Daniel Murphy and Helmut Januschka

            Kaan Alsan voted and added 1 comment

            Votes added by Kaan Alsan

            Code-Review+1

            1 comment

            File chrome/browser/ui/startup/focus/match_candidate.cc
            Line 91, Patchset 46 (Latest):std::optional<std::string> MatchAppByManifestId(
            Kaan Alsan . unresolved

            If this is only used within the .cc file, this should be in the anonymous namespace

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Daniel Murphy
            • Helmut Januschka
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • 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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
            Gerrit-Change-Number: 6943437
            Gerrit-PatchSet: 46
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
            Gerrit-CC: Jerome Jiang <ji...@chromium.org>
            Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
            Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
            Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Comment-Date: Fri, 10 Oct 2025 14:07:28 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Helmut Januschka (Gerrit)

            unread,
            Oct 10, 2025, 10:27:30 AM (2 days ago) Oct 10
            to Helmut Januschka, Daniel Murphy, Kaan Alsan, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
            Attention needed from Daniel Murphy

            Helmut Januschka added 1 comment

            File chrome/browser/ui/startup/focus/match_candidate.cc
            Line 91, Patchset 46:std::optional<std::string> MatchAppByManifestId(
            Kaan Alsan . resolved

            If this is only used within the .cc file, this should be in the anonymous namespace

            Helmut Januschka

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Daniel Murphy
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • 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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
            Gerrit-Change-Number: 6943437
            Gerrit-PatchSet: 48
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
            Gerrit-CC: Jerome Jiang <ji...@chromium.org>
            Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
            Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Comment-Date: Fri, 10 Oct 2025 14:26:35 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Daniel Murphy (Gerrit)

            unread,
            Oct 10, 2025, 8:00:46 PM (2 days ago) Oct 10
            to Helmut Januschka, Daniel Murphy, Kaan Alsan, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org
            Attention needed from Helmut Januschka

            Daniel Murphy voted and added 3 comments

            Votes added by Daniel Murphy

            Code-Review+1

            3 comments

            File chrome/browser/ui/startup/focus/focus_handler.cc
            Line 65, Patchset 45: web_app::WebAppProvider* provider =

            web_app::WebAppProvider::GetForWebApps(&profile);
            web_app::WebAppRegistrar* registrar =
            provider ? &provider->registrar_unsafe() : nullptr;
            Kaan Alsan . unresolved

            I'm not familiar enough with this code to be sure if this is the correct usage. Adding @dmu...@chromium.org to review this section.

            Daniel Murphy

            This is... _ok_. I think the main caveat here is that the app might be uninstalling or having some other in-progress operation. However, given that we are seeing browser windows that [seem to filter out any actively closing ones](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_window/internal/browser_window_interface_iterator_non_android.cc;l=37?q=ForEachCurrentBrowserWindowInterfaceOrderedByActivation&ss=chromium), this is likely safe.

            Maybe add

            ```
            // This is safe access for our use-case, as we are only using then when
            // encountering a browser with an AppBrowserController, which means that an app
            // is installed here, at least for now.
            ```

            File chrome/browser/ui/startup/focus/focus_handler_browsertest.cc
            Line 330, Patchset 51 (Latest):IN_PROC_BROWSER_TEST_F(FocusHandlerWebAppBrowserTest,
            Daniel Murphy . unresolved

            you should add a test that triggers a browser close asynchronously, and then tries to do the focus. The code that

            File chrome/browser/ui/startup/focus/match_candidate.cc
            Line 54, Patchset 51 (Latest): }
            Daniel Murphy . unresolved

            we also need to make sure this is a WebAppBrowserController - you can use the `AsWebAppBrowserController()` method. If it returns a nullptr, then skip this browser.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Helmut Januschka
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • 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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
            Gerrit-Change-Number: 6943437
            Gerrit-PatchSet: 51
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
            Gerrit-CC: Jerome Jiang <ji...@chromium.org>
            Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
            Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
            Gerrit-Comment-Date: Sat, 11 Oct 2025 00:00:16 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Helmut Januschka (Gerrit)

            unread,
            Oct 11, 2025, 3:34:47 PM (12 hours ago) Oct 11
            to Helmut Januschka, Daniel Murphy, Kaan Alsan, Mirko Bonadei, Jerome Jiang, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, penghuan...@chromium.org, fgal...@chromium.org, fuzzin...@chromium.org, jz...@chromium.org, devtools...@chromium.org, net-r...@chromium.org, cblume...@chromium.org, mar...@chromium.org, nicolas...@chromium.org, ydago...@chromium.org

            Helmut Januschka added 4 comments

            Patchset-level comments
            File-level comment, Patchset 52 (Latest):
            Helmut Januschka . resolved

            Thanks for the feedback, @dmu...@chromium.org! uploaded a new PS addressing all your comments — could you give it a quick look when you get a chance (even though you already gave a CR+1)?

            File chrome/browser/ui/startup/focus/focus_handler.cc
            Line 65, Patchset 45: web_app::WebAppProvider* provider =
            web_app::WebAppProvider::GetForWebApps(&profile);
            web_app::WebAppRegistrar* registrar =
            provider ? &provider->registrar_unsafe() : nullptr;
            Kaan Alsan . resolved

            I'm not familiar enough with this code to be sure if this is the correct usage. Adding @dmu...@chromium.org to review this section.

            Daniel Murphy

            This is... _ok_. I think the main caveat here is that the app might be uninstalling or having some other in-progress operation. However, given that we are seeing browser windows that [seem to filter out any actively closing ones](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/browser_window/internal/browser_window_interface_iterator_non_android.cc;l=37?q=ForEachCurrentBrowserWindowInterfaceOrderedByActivation&ss=chromium), this is likely safe.

            Maybe add

            ```
            // This is safe access for our use-case, as we are only using then when
            // encountering a browser with an AppBrowserController, which means that an app
            // is installed here, at least for now.
            ```

            Helmut Januschka

            Done

            File chrome/browser/ui/startup/focus/focus_handler_browsertest.cc
            Line 330, Patchset 51:IN_PROC_BROWSER_TEST_F(FocusHandlerWebAppBrowserTest,
            Daniel Murphy . resolved

            you should add a test that triggers a browser close asynchronously, and then tries to do the focus. The code that

            Helmut Januschka

            Done

            File chrome/browser/ui/startup/focus/match_candidate.cc
            Line 54, Patchset 51: }
            Daniel Murphy . resolved

            we also need to make sure this is a WebAppBrowserController - you can use the `AsWebAppBrowserController()` method. If it returns a nullptr, then skip this browser.

            Helmut Januschka

            Done

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not 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: I1d8b86ac37ca75298ceea3e031ca9ae15c823b7f
              Gerrit-Change-Number: 6943437
              Gerrit-PatchSet: 52
              Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
              Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Kaan Alsan <al...@chromium.org>
              Gerrit-CC: Jerome Jiang <ji...@chromium.org>
              Gerrit-CC: Mirko Bonadei <mbon...@chromium.org>
              Gerrit-Comment-Date: Sat, 11 Oct 2025 19:33:44 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Daniel Murphy <dmu...@chromium.org>
              Comment-In-Reply-To: Kaan Alsan <al...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages