From 66244f0ba202eb57497e6ab3abb9bd3b54c26a03 Mon Sep 17 00:00:00 2001 From: jhtin Date: Thu, 14 Apr 2022 04:29:33 +0000 Subject: [PATCH] Remove all instances of unused SuggesterSwitch.IsXAllowed() Bug: b/222218270 Change-Id: I0ceaa0b560d5c6777a44ce9acfffa0eddbcbe8a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3583104 Auto-Submit: jhtin Reviewed-by: Keith Lee Commit-Queue: Keith Lee Reviewed-by: John Palmer Cr-Commit-Position: refs/heads/main@{#992394} --- .../assistive_suggester_client_filter.cc | 12 ------------ .../assistive_suggester_client_filter.h | 5 +---- .../input_method/assistive_suggester_switch.h | 18 ------------------ .../assistive_suggester_unittest.cc | 14 +------------- .../native_input_method_engine_unittest.cc | 14 +------------- 5 files changed, 3 insertions(+), 60 deletions(-) diff --git a/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc b/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc index eedd0eed8e8000..27db0a653d794f 100644 --- a/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc +++ b/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc @@ -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))); diff --git a/chrome/browser/ash/input_method/assistive_suggester_client_filter.h b/chrome/browser/ash/input_method/assistive_suggester_client_filter.h index 44b4477ee77f9c..b52dd2fcf4b0d1 100644 --- a/chrome/browser/ash/input_method/assistive_suggester_client_filter.h +++ b/chrome/browser/ash/input_method/assistive_suggester_client_filter.h @@ -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; diff --git a/chrome/browser/ash/input_method/assistive_suggester_switch.h b/chrome/browser/ash/input_method/assistive_suggester_switch.h index 92cab1ed97a675..71b27f405eb9a2 100644 --- a/chrome/browser/ash/input_method/assistive_suggester_switch.h +++ b/chrome/browser/ash/input_method/assistive_suggester_switch.h @@ -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; diff --git a/chrome/browser/ash/input_method/assistive_suggester_unittest.cc b/chrome/browser/ash/input_method/assistive_suggester_unittest.cc index 2b0213df6c3264..8569041f14b9ff 100644 --- a/chrome/browser/ash/input_method/assistive_suggester_unittest.cc +++ b/chrome/browser/ash/input_method/assistive_suggester_unittest.cc @@ -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_); diff --git a/chrome/browser/ash/input_method/native_input_method_engine_unittest.cc b/chrome/browser/ash/input_method/native_input_method_engine_unittest.cc index 8ecef823f0319f..32467b475d3476 100644 --- a/chrome/browser/ash/input_method/native_input_method_engine_unittest.cc +++ b/chrome/browser/ash/input_method/native_input_method_engine_unittest.cc @@ -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_);