Skip to content

Commit

Permalink
Remove all instances of unused SuggesterSwitch.IsXAllowed()
Browse files Browse the repository at this point in the history
Bug: b/222218270
Change-Id: I0ceaa0b560d5c6777a44ce9acfffa0eddbcbe8a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3583104
Auto-Submit: jhtin <jhtin@chromium.org>
Reviewed-by: Keith Lee <keithlee@chromium.org>
Commit-Queue: Keith Lee <keithlee@chromium.org>
Reviewed-by: John Palmer <jopalmer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#992394}
  • Loading branch information
jhtin authored and Chromium LUCI CQ committed Apr 14, 2022
1 parent 3532f81 commit 66244f0
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 60 deletions.
Expand Up @@ -278,18 +278,6 @@ AssistiveSuggesterClientFilter::AssistiveSuggesterClientFilter(

AssistiveSuggesterClientFilter::~AssistiveSuggesterClientFilter() = default;

bool AssistiveSuggesterClientFilter::IsEmojiSuggestionAllowed() {
return IsAllowedUrlOrAppForEmojiSuggestion();
}

bool AssistiveSuggesterClientFilter::IsMultiWordSuggestionAllowed() {
return IsAllowedUrlOrAppForMultiWordSuggestion();
}

bool AssistiveSuggesterClientFilter::IsPersonalInfoSuggestionAllowed() {
return IsAllowedUrlOrAppForPersonalInfoSuggestion();
}

void AssistiveSuggesterClientFilter::FetchEnabledSuggestionsThen(
FetchEnabledSuggestionsCallback callback) {
get_url_.Run(base::BindOnce(ReturnEnabledSuggestions, std::move(callback)));
Expand Down
Expand Up @@ -22,10 +22,7 @@ class AssistiveSuggesterClientFilter : public AssistiveSuggesterSwitch {

~AssistiveSuggesterClientFilter() override;

// AssistiveSuggesterDelegate overrides
bool IsEmojiSuggestionAllowed() override;
bool IsMultiWordSuggestionAllowed() override;
bool IsPersonalInfoSuggestionAllowed() override;
// AssistiveSuggesterSwitch overrides
void FetchEnabledSuggestionsThen(
FetchEnabledSuggestionsCallback callback) override;

Expand Down
18 changes: 0 additions & 18 deletions chrome/browser/ash/input_method/assistive_suggester_switch.h
Expand Up @@ -29,24 +29,6 @@ class AssistiveSuggesterSwitch {
AssistiveSuggesterSwitch() = default;
virtual ~AssistiveSuggesterSwitch() = default;

// Are emoji suggestions allowed to be surfaced to the user?
//
// TODO(crbug/1146266): Deprecated, remove this method in favor of
// FetchEnabledSuggestionsThen.
virtual bool IsEmojiSuggestionAllowed() = 0;

// Are multi word suggestions allowed to be surfaced to the user?
//
// TODO(crbug/1146266): Deprecated, remove this method in favor of
// FetchEnabledSuggestionsThen.
virtual bool IsMultiWordSuggestionAllowed() = 0;

// Are personal info suggestions allowed to be surfaced to the user?
//
// TODO(crbug/1146266): Deprecated, remove this method in favor of
// FetchEnabledSuggestionsThen.
virtual bool IsPersonalInfoSuggestionAllowed() = 0;

using FetchEnabledSuggestionsCallback =
base::OnceCallback<void(const EnabledSuggestions&)>;

Expand Down
14 changes: 1 addition & 13 deletions chrome/browser/ash/input_method/assistive_suggester_unittest.cc
Expand Up @@ -86,19 +86,7 @@ class FakeSuggesterSwitch : public AssistiveSuggesterSwitch {
: enabled_suggestions_(enabled_suggestions) {}
~FakeSuggesterSwitch() override = default;

// AssistiveSuggesterDelegate overrides
bool IsEmojiSuggestionAllowed() override {
return enabled_suggestions_.emoji_suggestions;
}

bool IsMultiWordSuggestionAllowed() override {
return enabled_suggestions_.multi_word_suggestions;
}

bool IsPersonalInfoSuggestionAllowed() override {
return enabled_suggestions_.personal_info_suggestions;
}

// AssistiveSuggesterSwitch overrides
void FetchEnabledSuggestionsThen(
FetchEnabledSuggestionsCallback callback) override {
std::move(callback).Run(enabled_suggestions_);
Expand Down
Expand Up @@ -58,19 +58,7 @@ class FakeSuggesterSwitch : public AssistiveSuggesterSwitch {
: enabled_suggestions_(enabled_suggestions) {}
~FakeSuggesterSwitch() override = default;

// AssistiveSuggesterDelegate overrides
bool IsEmojiSuggestionAllowed() override {
return enabled_suggestions_.emoji_suggestions;
}

bool IsMultiWordSuggestionAllowed() override {
return enabled_suggestions_.multi_word_suggestions;
}

bool IsPersonalInfoSuggestionAllowed() override {
return enabled_suggestions_.personal_info_suggestions;
}

// AssistiveSuggesterSwitch overrides
void FetchEnabledSuggestionsThen(
FetchEnabledSuggestionsCallback callback) override {
std::move(callback).Run(enabled_suggestions_);
Expand Down

0 comments on commit 66244f0

Please sign in to comment.