Commit 6c73f465 authored by David Vallet's avatar David Vallet Committed by Commit Bot

go/coil on input_method folder

Bug: 1124062
Change-Id: I5422ddab8a7e9fafa9042bd65e59b1430dc4211a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422106Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Commit-Queue: David Vallet <dvallet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810058}
parent cbeb2096
...@@ -37,10 +37,10 @@ namespace chromeos { ...@@ -37,10 +37,10 @@ namespace chromeos {
namespace { namespace {
struct WhitelistedComponentExtensionIME { struct AllowlistedComponentExtensionIME {
const char* id; const char* id;
int manifest_resource_id; int manifest_resource_id;
} whitelisted_component_extensions[] = { } allowlisted_component_extensions[] = {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
{ {
// Official Google XKB Input. // Official Google XKB Input.
...@@ -212,7 +212,7 @@ ComponentExtensionIMEManagerImpl::GetManifest( ...@@ -212,7 +212,7 @@ ComponentExtensionIMEManagerImpl::GetManifest(
// static // static
bool ComponentExtensionIMEManagerImpl::IsIMEExtensionID(const std::string& id) { bool ComponentExtensionIMEManagerImpl::IsIMEExtensionID(const std::string& id) {
for (auto& extension : whitelisted_component_extensions) { for (auto& extension : allowlisted_component_extensions) {
if (base::LowerCaseEqualsASCII(id, extension.id)) if (base::LowerCaseEqualsASCII(id, extension.id))
return true; return true;
} }
...@@ -336,7 +336,7 @@ bool ComponentExtensionIMEManagerImpl::ReadExtensionInfo( ...@@ -336,7 +336,7 @@ bool ComponentExtensionIMEManagerImpl::ReadExtensionInfo(
void ComponentExtensionIMEManagerImpl::ReadComponentExtensionsInfo( void ComponentExtensionIMEManagerImpl::ReadComponentExtensionsInfo(
std::vector<ComponentExtensionIME>* out_imes) { std::vector<ComponentExtensionIME>* out_imes) {
DCHECK(out_imes); DCHECK(out_imes);
for (auto& extension : whitelisted_component_extensions) { for (auto& extension : allowlisted_component_extensions) {
ComponentExtensionIME component_ime; ComponentExtensionIME component_ime;
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
component_ime.manifest = component_ime.manifest =
......
...@@ -56,7 +56,7 @@ bool IsDownloadPathValid(const base::FilePath& file_path) { ...@@ -56,7 +56,7 @@ bool IsDownloadPathValid(const base::FilePath& file_path) {
} }
bool IsDownloadURLValid(const GURL& url) { bool IsDownloadURLValid(const GURL& url) {
// TODO(https://crbug.com/837156): Whitelist all URLs instead of some general // TODO(https://crbug.com/837156): Allowlist all URLs instead of some general
// checks below. // checks below.
return url.SchemeIs(url::kHttpsScheme) && return url.SchemeIs(url::kHttpsScheme) &&
url.DomainIs(chromeos::ime::kGoogleKeyboardDownloadDomain); url.DomainIs(chromeos::ime::kGoogleKeyboardDownloadDomain);
......
...@@ -104,7 +104,7 @@ class InputMethodEngineBrowserTest ...@@ -104,7 +104,7 @@ class InputMethodEngineBrowserTest
// extension IME. // extension IME.
// Note: Even extension is loaded by LoadExtensionAsComponent as above, the // Note: Even extension is loaded by LoadExtensionAsComponent as above, the
// IME does not managed by ComponentExtensionIMEManager or it's id won't // IME does not managed by ComponentExtensionIMEManager or it's id won't
// start with __comp__. The component extension IME is whitelisted and // start with __comp__. The component extension IME is allowlisted and
// managed by ComponentExtensionIMEManager, but its framework is same as // managed by ComponentExtensionIMEManager, but its framework is same as
// normal extension IME. // normal extension IME.
EXPECT_EQ(3U, extension_imes.size()); EXPECT_EQ(3U, extension_imes.size());
......
...@@ -170,12 +170,12 @@ class InputMethodEngineTest : public testing::Test { ...@@ -170,12 +170,12 @@ class InputMethodEngineTest : public testing::Test {
} }
protected: protected:
void CreateEngine(bool whitelisted) { void CreateEngine(bool allowlisted) {
engine_.reset(new InputMethodEngine()); engine_.reset(new InputMethodEngine());
observer_ = new TestObserver(); observer_ = new TestObserver();
std::unique_ptr<InputMethodEngineBase::Observer> observer_ptr(observer_); std::unique_ptr<InputMethodEngineBase::Observer> observer_ptr(observer_);
engine_->Initialize(std::move(observer_ptr), engine_->Initialize(std::move(observer_ptr),
whitelisted ? kTestExtensionId : kTestExtensionId2, allowlisted ? kTestExtensionId : kTestExtensionId2,
nullptr); nullptr);
} }
...@@ -268,7 +268,7 @@ TEST_F(InputMethodEngineTest, TestSwitching_Password_3rd_Party) { ...@@ -268,7 +268,7 @@ TEST_F(InputMethodEngineTest, TestSwitching_Password_3rd_Party) {
EXPECT_EQ(kTestImeComponentId, observer_->GetEngineIdAndReset()); EXPECT_EQ(kTestImeComponentId, observer_->GetEngineIdAndReset());
} }
TEST_F(InputMethodEngineTest, TestSwitching_Password_Whitelisted) { TEST_F(InputMethodEngineTest, TestSwitching_Password_Allowlisted) {
CreateEngine(true); CreateEngine(true);
// Enable/disable with focus. // Enable/disable with focus.
FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD); FocusIn(ui::TEXT_INPUT_TYPE_PASSWORD);
......
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