Commit c54ba37e authored by Zufeng Wang's avatar Zufeng Wang Committed by Commit Bot

Stop showing release notes suggestion chip when clicked

Previous behavior: Clicking the suggestion chip launches the app but the
chip stays there.
This CL: In addition to launching the app, it stops the suggestion chip
from appearing.

Note: Does not fix the issue of the chip not disappearing after being
viewed three times.

Bug: b/169711884
Change-Id: I5760b66c1a086d770728bb1c720806de0333a850
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440328
Commit-Queue: Zufeng Wang <zufeng@google.com>
Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813079}
parent b25a8522
...@@ -111,4 +111,9 @@ void ReleaseNotesStorage::DecreaseTimesLeftToShowSuggestionChip() { ...@@ -111,4 +111,9 @@ void ReleaseNotesStorage::DecreaseTimesLeftToShowSuggestionChip() {
times_left_to_show - 1); times_left_to_show - 1);
} }
void ReleaseNotesStorage::StopShowingSuggestionChip() {
profile_->GetPrefs()->SetInteger(
prefs::kReleaseNotesSuggestionChipTimesLeftToShow, 0);
}
} // namespace chromeos } // namespace chromeos
...@@ -35,6 +35,9 @@ class ReleaseNotesStorage { ...@@ -35,6 +35,9 @@ class ReleaseNotesStorage {
// Decreases the amount of times left to show the suggestion chip. // Decreases the amount of times left to show the suggestion chip.
void DecreaseTimesLeftToShowSuggestionChip(); void DecreaseTimesLeftToShowSuggestionChip();
// Sets the number of times left to show the suggestion chip to 0.
void StopShowingSuggestionChip();
private: private:
Profile* const profile_; Profile* const profile_;
......
...@@ -172,6 +172,7 @@ void AppServiceAppResult::Launch(int event_flags, ...@@ -172,6 +172,7 @@ void AppServiceAppResult::Launch(int event_flags,
base::UserMetricsAction("ReleaseNotes.SuggestionChipLaunched")); base::UserMetricsAction("ReleaseNotes.SuggestionChipLaunched"));
proxy->LaunchAppWithUrl(app_id(), event_flags, query_url().value(), proxy->LaunchAppWithUrl(app_id(), event_flags, query_url().value(),
launch_source, controller()->GetAppListDisplayId()); launch_source, controller()->GetAppListDisplayId());
chromeos::ReleaseNotesStorage(profile()).StopShowingSuggestionChip();
return; return;
} }
......
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