Commit 08860249 authored by Travis Skare's avatar Travis Skare Committed by Commit Bot

[QRCode Generator] persist icon after omnibox unfocus.

This matches Send-Tab-To-Self behavior.

Bug: 1096772
Change-Id: I97bca836b56ae359df7c6609ff00438dfdbd8f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264892Reviewed-by: default avatarmanuk hovanesian <manukh@chromium.org>
Commit-Queue: Travis Skare <skare@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782580}
parent 6aff2b7f
...@@ -718,6 +718,12 @@ void LocationBarView::Update(WebContents* contents) { ...@@ -718,6 +718,12 @@ void LocationBarView::Update(WebContents* contents) {
if (send_tab_to_self_icon) if (send_tab_to_self_icon)
send_tab_to_self_icon->SetVisible(false); send_tab_to_self_icon->SetVisible(false);
PageActionIconView* qr_generator_icon =
page_action_icon_controller_->GetIconView(
PageActionIconType::kQRCodeGenerator);
if (qr_generator_icon)
qr_generator_icon->SetVisible(false);
OnChanged(); // NOTE: Calls Layout(). OnChanged(); // NOTE: Calls Layout().
} }
......
...@@ -57,7 +57,7 @@ void QRCodeGeneratorIconView::UpdateImpl() { ...@@ -57,7 +57,7 @@ void QRCodeGeneratorIconView::UpdateImpl() {
bool feature_available = bool feature_available =
QRCodeGeneratorBubbleController::IsGeneratorAvailable( QRCodeGeneratorBubbleController::IsGeneratorAvailable(
web_contents->GetURL(), web_contents->GetLastCommittedURL(),
web_contents->GetBrowserContext()->IsOffTheRecord()); web_contents->GetBrowserContext()->IsOffTheRecord());
bool visible = GetBubble() != nullptr || bool visible = GetBubble() != nullptr ||
...@@ -73,7 +73,10 @@ void QRCodeGeneratorIconView::UpdateImpl() { ...@@ -73,7 +73,10 @@ void QRCodeGeneratorIconView::UpdateImpl() {
// inkdrop or going through a hide/show cycle. // inkdrop or going through a hide/show cycle.
visible |= bubble_requested_; visible |= bubble_requested_;
SetVisible(visible); // The icon is cleared on navigations and similar in
// LocationVarView::Update().
if (visible)
SetVisible(true);
} }
void QRCodeGeneratorIconView::OnExecuting( void QRCodeGeneratorIconView::OnExecuting(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment