Skip to content

Commit

Permalink
[M101][QrCode] Fix QR code icon not appearing in the omnibox for CrOS
Browse files Browse the repository at this point in the history
Both qr code and STTS icons were hidden mistakenly while cleaning up
the CrOS sharing hub feature flag.

(cherry picked from commit 36e4e72)

Bug: 1309640
Change-Id: I2bfbf89eccef05939f9739566678ce647aad4989
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3584491
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Kristi Park <kristipark@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#992205}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3593967
Auto-Submit: Kristi Park <kristipark@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/4951@{#891}
Cr-Branched-From: 27de622-refs/heads/main@{#982481}
  • Loading branch information
Kristi Park authored and Chromium LUCI CQ committed Apr 19, 2022
1 parent 1e5fb1e commit e6f79bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions chrome/browser/sharing_hub/sharing_hub_features.cc
Expand Up @@ -39,15 +39,15 @@ bool ScreenshotsDisabledByPolicy(content::BrowserContext* context) {
} // namespace

bool SharingHubOmniboxEnabled(content::BrowserContext* context) {
#if !BUILDFLAG(IS_CHROMEOS)
if (SharingHubDisabledByPolicy(context))
return false;
#endif

#if BUILDFLAG(IS_CHROMEOS)
return false;
#else
Profile* profile = Profile::FromBrowserContext(context);
if (!profile)
return false;
return !profile->IsIncognitoProfile() && !profile->IsGuestSession();
return !SharingHubDisabledByPolicy(context) &&
!profile->IsIncognitoProfile() && !profile->IsGuestSession();
#endif
}

bool DesktopScreenshotsFeatureEnabled(content::BrowserContext* context) {
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/sharing_hub/sharing_hub_features.h
Expand Up @@ -16,7 +16,8 @@ class BrowserContext;

namespace sharing_hub {

// Returns true if the omnibox sharing hub is enabled for |context|.
// Returns true if the omnibox sharing hub is enabled for |context|. Only for
// Windows/Mac/Linux. ChromeOS opens the native sharesheet.
bool SharingHubOmniboxEnabled(content::BrowserContext* context);

// Returns true if the desktop screenshots feature is enabled.
Expand Down
Expand Up @@ -143,7 +143,11 @@ Profile* SharingHubBubbleController::GetProfile() const {
}

bool SharingHubBubbleController::ShouldOfferOmniboxIcon() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
return !GetProfile()->IsIncognitoProfile() && !GetProfile()->IsGuestSession();
#else
return SharingHubOmniboxEnabled(GetWebContents().GetBrowserContext());
#endif
}

std::vector<SharingHubAction>
Expand Down

0 comments on commit e6f79bf

Please sign in to comment.