Commit 2e7da93c authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

ime: Run clang-tidy over ui/base/ime/chromeos.

Mostly adds = default and changes typedef to using.

Change-Id: Ic9d8ab0caf10acf8b86e97a02d5dcd15764d3148
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532023Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827667}
parent 9a3da8cb
...@@ -19,7 +19,7 @@ struct ComponentExtensionIME; ...@@ -19,7 +19,7 @@ struct ComponentExtensionIME;
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
ComponentExtensionIMEManagerDelegate { ComponentExtensionIMEManagerDelegate {
public: public:
virtual ~ComponentExtensionIMEManagerDelegate() {} virtual ~ComponentExtensionIMEManagerDelegate() = default;
// Lists installed component extension IMEs. // Lists installed component extension IMEs.
virtual std::vector<ComponentExtensionIME> ListIME() = 0; virtual std::vector<ComponentExtensionIME> ListIME() = 0;
......
...@@ -19,11 +19,10 @@ namespace input_method { ...@@ -19,11 +19,10 @@ namespace input_method {
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) FakeInputMethodDelegate class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) FakeInputMethodDelegate
: public InputMethodDelegate { : public InputMethodDelegate {
public: public:
typedef base::RepeatingCallback<base::string16( using LanguageNameLocalizationCallback =
const std::string& language_code)> base::RepeatingCallback<base::string16(const std::string&)>;
LanguageNameLocalizationCallback; using GetLocalizedStringCallback =
typedef base::RepeatingCallback<base::string16(int resource_id)> base::RepeatingCallback<base::string16(int)>;
GetLocalizedStringCallback;
FakeInputMethodDelegate(); FakeInputMethodDelegate();
~FakeInputMethodDelegate() override; ~FakeInputMethodDelegate() override;
......
...@@ -34,7 +34,7 @@ struct Bounds { ...@@ -34,7 +34,7 @@ struct Bounds {
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
IMEAssistiveWindowHandlerInterface { IMEAssistiveWindowHandlerInterface {
public: public:
virtual ~IMEAssistiveWindowHandlerInterface() {} virtual ~IMEAssistiveWindowHandlerInterface() = default;
// Called when showing/hiding assistive window. // Called when showing/hiding assistive window.
virtual void SetAssistiveWindowProperties( virtual void SetAssistiveWindowProperties(
...@@ -65,7 +65,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) ...@@ -65,7 +65,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
virtual void FocusStateChanged() {} virtual void FocusStateChanged() {}
protected: protected:
IMEAssistiveWindowHandlerInterface() {} IMEAssistiveWindowHandlerInterface() = default;
}; };
} // namespace chromeos } // namespace chromeos
......
...@@ -25,7 +25,7 @@ class IMEBridgeImpl : public IMEBridge { ...@@ -25,7 +25,7 @@ class IMEBridgeImpl : public IMEBridge {
ui::TextInputClient::FOCUS_REASON_NONE, ui::TextInputClient::FOCUS_REASON_NONE,
false /* should_do_learning */) {} false /* should_do_learning */) {}
~IMEBridgeImpl() override {} ~IMEBridgeImpl() override = default;
// IMEBridge override. // IMEBridge override.
IMEInputContextHandlerInterface* GetInputContextHandler() const override { IMEInputContextHandlerInterface* GetInputContextHandler() const override {
...@@ -118,9 +118,9 @@ class IMEBridgeImpl : public IMEBridge { ...@@ -118,9 +118,9 @@ class IMEBridgeImpl : public IMEBridge {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// IMEBridge // IMEBridge
IMEBridge::IMEBridge() {} IMEBridge::IMEBridge() = default;
IMEBridge::~IMEBridge() {} IMEBridge::~IMEBridge() = default;
// static. // static.
void IMEBridge::Initialize() { void IMEBridge::Initialize() {
......
...@@ -16,7 +16,7 @@ class Rect; ...@@ -16,7 +16,7 @@ class Rect;
namespace ui { namespace ui {
class CandidateWindow; class CandidateWindow;
} } // namespace ui
namespace chromeos { namespace chromeos {
...@@ -24,7 +24,7 @@ namespace chromeos { ...@@ -24,7 +24,7 @@ namespace chromeos {
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
IMECandidateWindowHandlerInterface { IMECandidateWindowHandlerInterface {
public: public:
virtual ~IMECandidateWindowHandlerInterface() {} virtual ~IMECandidateWindowHandlerInterface() = default;
// Called when the IME updates the lookup table. // Called when the IME updates the lookup table.
virtual void UpdateLookupTable(const ui::CandidateWindow& candidate_window, virtual void UpdateLookupTable(const ui::CandidateWindow& candidate_window,
...@@ -48,7 +48,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) ...@@ -48,7 +48,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
virtual void FocusStateChanged(bool is_focused) {} virtual void FocusStateChanged(bool is_focused) {}
protected: protected:
IMECandidateWindowHandlerInterface() {} IMECandidateWindowHandlerInterface() = default;
}; };
} // namespace chromeos } // namespace chromeos
......
...@@ -34,13 +34,13 @@ struct AssistiveWindowButton; ...@@ -34,13 +34,13 @@ struct AssistiveWindowButton;
// A interface to handle the engine handler method call. // A interface to handle the engine handler method call.
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface { class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface {
public: public:
typedef base::OnceCallback<void(bool consumed)> KeyEventDoneCallback; using KeyEventDoneCallback = base::OnceCallback<void(bool)>;
// A information about a focused text input field. // A information about a focused text input field.
// A type of each member is based on the html spec, but InputContext can be // A type of each member is based on the html spec, but InputContext can be
// used to specify about a non html text field like Omnibox. // used to specify about a non html text field like Omnibox.
struct InputContext { struct InputContext {
InputContext() {} InputContext() = default;
InputContext(TextInputType type_, InputContext(TextInputType type_,
TextInputMode mode_, TextInputMode mode_,
int flags_, int flags_,
...@@ -84,7 +84,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface { ...@@ -84,7 +84,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface {
bool should_do_learning = false; bool should_do_learning = false;
}; };
virtual ~IMEEngineHandlerInterface() {} virtual ~IMEEngineHandlerInterface() = default;
// Called when the Chrome input field get the focus. // Called when the Chrome input field get the focus.
virtual void FocusIn(const InputContext& input_context) = 0; virtual void FocusIn(const InputContext& input_context) = 0;
...@@ -139,7 +139,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface { ...@@ -139,7 +139,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface {
virtual void SetCastingEnabled(bool casting_enabled) = 0; virtual void SetCastingEnabled(bool casting_enabled) = 0;
protected: protected:
IMEEngineHandlerInterface() {} IMEEngineHandlerInterface() = default;
}; };
} // namespace ui } // namespace ui
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace ui { namespace ui {
class InputController; class InputController;
} } // namespace ui
namespace chromeos { namespace chromeos {
namespace input_method { namespace input_method {
......
...@@ -14,7 +14,7 @@ namespace chromeos { ...@@ -14,7 +14,7 @@ namespace chromeos {
namespace input_method { namespace input_method {
class InputMethodDescriptor; class InputMethodDescriptor;
typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; using InputMethodDescriptors = std::vector<InputMethodDescriptor>;
namespace allowlist { namespace allowlist {
......
...@@ -43,7 +43,7 @@ namespace { ...@@ -43,7 +43,7 @@ namespace {
const base::string16 kSampleText = base::UTF8ToUTF16( const base::string16 kSampleText = base::UTF8ToUTF16(
"\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A"); "\xE3\x81\x82\xE3\x81\x84\xE3\x81\x86\xE3\x81\x88\xE3\x81\x8A");
typedef IMEEngineHandlerInterface::KeyEventDoneCallback KeyEventCallback; using KeyEventCallback = IMEEngineHandlerInterface::KeyEventDoneCallback;
uint32_t GetOffsetInUTF16(const base::string16& utf16_string, uint32_t GetOffsetInUTF16(const base::string16& utf16_string,
uint32_t utf8_offset) { uint32_t utf8_offset) {
......
...@@ -84,7 +84,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodDescriptor { ...@@ -84,7 +84,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodDescriptor {
GURL input_view_url_; GURL input_view_url_;
}; };
typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; using InputMethodDescriptors = std::vector<InputMethodDescriptor>;
} // namespace input_method } // namespace input_method
} // namespace chromeos } // namespace chromeos
......
...@@ -11,7 +11,7 @@ namespace input_method { ...@@ -11,7 +11,7 @@ namespace input_method {
namespace { namespace {
InputMethodManager* g_input_method_manager = nullptr; InputMethodManager* g_input_method_manager = nullptr;
} } // namespace
InputMethodManager::State::~State() = default; InputMethodManager::State::~State() = default;
......
...@@ -760,7 +760,7 @@ void InputMethodUtil::AppendInputMethods(const InputMethodDescriptors& imes) { ...@@ -760,7 +760,7 @@ void InputMethodUtil::AppendInputMethods(const InputMethodDescriptors& imes) {
input_method.language_codes(); input_method.language_codes();
id_to_descriptor_[input_method.id()] = input_method; id_to_descriptor_[input_method.id()] = input_method;
typedef LanguageCodeToIdsMap::const_iterator It; using It = LanguageCodeToIdsMap::const_iterator;
for (const auto& language_code : language_codes) { for (const auto& language_code : language_codes) {
std::pair<It, It> range = std::pair<It, It> range =
language_code_to_ids_.equal_range(language_code); language_code_to_ids_.equal_range(language_code);
......
...@@ -144,8 +144,8 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodUtil { ...@@ -144,8 +144,8 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodUtil {
void InitXkbInputMethodsForTesting(const InputMethodDescriptors& imes); void InitXkbInputMethodsForTesting(const InputMethodDescriptors& imes);
// Map from input method ID to associated input method descriptor. // Map from input method ID to associated input method descriptor.
typedef std::map< using InputMethodIdToDescriptorMap =
std::string, InputMethodDescriptor> InputMethodIdToDescriptorMap; std::map<std::string, InputMethodDescriptor>;
// Returns the fallback input method descriptor (the very basic US // Returns the fallback input method descriptor (the very basic US
// keyboard). This function is mostly used for testing, but may be used // keyboard). This function is mostly used for testing, but may be used
...@@ -183,7 +183,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodUtil { ...@@ -183,7 +183,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodUtil {
const InputMethodDescriptor& input_method, bool short_name) const; const InputMethodDescriptor& input_method, bool short_name) const;
// Map from language code to associated input method IDs, etc. // Map from language code to associated input method IDs, etc.
typedef std::multimap<std::string, std::string> LanguageCodeToIdsMap; using LanguageCodeToIdsMap = std::multimap<std::string, std::string>;
LanguageCodeToIdsMap language_code_to_ids_; LanguageCodeToIdsMap language_code_to_ids_;
InputMethodIdToDescriptorMap id_to_descriptor_; InputMethodIdToDescriptorMap id_to_descriptor_;
......
...@@ -9,7 +9,7 @@ namespace chromeos { ...@@ -9,7 +9,7 @@ namespace chromeos {
namespace input_method { namespace input_method {
MockComponentExtensionIMEManagerDelegate:: MockComponentExtensionIMEManagerDelegate::
MockComponentExtensionIMEManagerDelegate() {} MockComponentExtensionIMEManagerDelegate() = default;
MockComponentExtensionIMEManagerDelegate:: MockComponentExtensionIMEManagerDelegate::
~MockComponentExtensionIMEManagerDelegate() = default; ~MockComponentExtensionIMEManagerDelegate() = default;
......
...@@ -19,7 +19,7 @@ MockIMEInputContextHandler::MockIMEInputContextHandler() ...@@ -19,7 +19,7 @@ MockIMEInputContextHandler::MockIMEInputContextHandler()
update_preedit_text_call_count_(0), update_preedit_text_call_count_(0),
delete_surrounding_text_call_count_(0) {} delete_surrounding_text_call_count_(0) {}
MockIMEInputContextHandler::~MockIMEInputContextHandler() {} MockIMEInputContextHandler::~MockIMEInputContextHandler() = default;
void MockIMEInputContextHandler::CommitText(const std::string& text) { void MockIMEInputContextHandler::CommitText(const std::string& text) {
++commit_text_call_count_; ++commit_text_call_count_;
......
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