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;
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
ComponentExtensionIMEManagerDelegate {
public:
virtual ~ComponentExtensionIMEManagerDelegate() {}
virtual ~ComponentExtensionIMEManagerDelegate() = default;
// Lists installed component extension IMEs.
virtual std::vector<ComponentExtensionIME> ListIME() = 0;
......
......@@ -19,11 +19,10 @@ namespace input_method {
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) FakeInputMethodDelegate
: public InputMethodDelegate {
public:
typedef base::RepeatingCallback<base::string16(
const std::string& language_code)>
LanguageNameLocalizationCallback;
typedef base::RepeatingCallback<base::string16(int resource_id)>
GetLocalizedStringCallback;
using LanguageNameLocalizationCallback =
base::RepeatingCallback<base::string16(const std::string&)>;
using GetLocalizedStringCallback =
base::RepeatingCallback<base::string16(int)>;
FakeInputMethodDelegate();
~FakeInputMethodDelegate() override;
......
......@@ -34,7 +34,7 @@ struct Bounds {
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
IMEAssistiveWindowHandlerInterface {
public:
virtual ~IMEAssistiveWindowHandlerInterface() {}
virtual ~IMEAssistiveWindowHandlerInterface() = default;
// Called when showing/hiding assistive window.
virtual void SetAssistiveWindowProperties(
......@@ -65,7 +65,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
virtual void FocusStateChanged() {}
protected:
IMEAssistiveWindowHandlerInterface() {}
IMEAssistiveWindowHandlerInterface() = default;
};
} // namespace chromeos
......
......@@ -25,7 +25,7 @@ class IMEBridgeImpl : public IMEBridge {
ui::TextInputClient::FOCUS_REASON_NONE,
false /* should_do_learning */) {}
~IMEBridgeImpl() override {}
~IMEBridgeImpl() override = default;
// IMEBridge override.
IMEInputContextHandlerInterface* GetInputContextHandler() const override {
......@@ -118,9 +118,9 @@ class IMEBridgeImpl : public IMEBridge {
///////////////////////////////////////////////////////////////////////////////
// IMEBridge
IMEBridge::IMEBridge() {}
IMEBridge::IMEBridge() = default;
IMEBridge::~IMEBridge() {}
IMEBridge::~IMEBridge() = default;
// static.
void IMEBridge::Initialize() {
......
......@@ -16,7 +16,7 @@ class Rect;
namespace ui {
class CandidateWindow;
}
} // namespace ui
namespace chromeos {
......@@ -24,7 +24,7 @@ namespace chromeos {
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
IMECandidateWindowHandlerInterface {
public:
virtual ~IMECandidateWindowHandlerInterface() {}
virtual ~IMECandidateWindowHandlerInterface() = default;
// Called when the IME updates the lookup table.
virtual void UpdateLookupTable(const ui::CandidateWindow& candidate_window,
......@@ -48,7 +48,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS)
virtual void FocusStateChanged(bool is_focused) {}
protected:
IMECandidateWindowHandlerInterface() {}
IMECandidateWindowHandlerInterface() = default;
};
} // namespace chromeos
......
......@@ -34,13 +34,13 @@ struct AssistiveWindowButton;
// A interface to handle the engine handler method call.
class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface {
public:
typedef base::OnceCallback<void(bool consumed)> KeyEventDoneCallback;
using KeyEventDoneCallback = base::OnceCallback<void(bool)>;
// A information about a focused text input field.
// 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.
struct InputContext {
InputContext() {}
InputContext() = default;
InputContext(TextInputType type_,
TextInputMode mode_,
int flags_,
......@@ -84,7 +84,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface {
bool should_do_learning = false;
};
virtual ~IMEEngineHandlerInterface() {}
virtual ~IMEEngineHandlerInterface() = default;
// Called when the Chrome input field get the focus.
virtual void FocusIn(const InputContext& input_context) = 0;
......@@ -139,7 +139,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) IMEEngineHandlerInterface {
virtual void SetCastingEnabled(bool casting_enabled) = 0;
protected:
IMEEngineHandlerInterface() {}
IMEEngineHandlerInterface() = default;
};
} // namespace ui
......
......@@ -11,7 +11,7 @@
namespace ui {
class InputController;
}
} // namespace ui
namespace chromeos {
namespace input_method {
......
......@@ -14,7 +14,7 @@ namespace chromeos {
namespace input_method {
class InputMethodDescriptor;
typedef std::vector<InputMethodDescriptor> InputMethodDescriptors;
using InputMethodDescriptors = std::vector<InputMethodDescriptor>;
namespace allowlist {
......
......@@ -43,7 +43,7 @@ namespace {
const base::string16 kSampleText = base::UTF8ToUTF16(
"\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 utf8_offset) {
......
......@@ -84,7 +84,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodDescriptor {
GURL input_view_url_;
};
typedef std::vector<InputMethodDescriptor> InputMethodDescriptors;
using InputMethodDescriptors = std::vector<InputMethodDescriptor>;
} // namespace input_method
} // namespace chromeos
......
......@@ -11,7 +11,7 @@ namespace input_method {
namespace {
InputMethodManager* g_input_method_manager = nullptr;
}
} // namespace
InputMethodManager::State::~State() = default;
......
......@@ -760,7 +760,7 @@ void InputMethodUtil::AppendInputMethods(const InputMethodDescriptors& imes) {
input_method.language_codes();
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) {
std::pair<It, It> range =
language_code_to_ids_.equal_range(language_code);
......
......@@ -144,8 +144,8 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodUtil {
void InitXkbInputMethodsForTesting(const InputMethodDescriptors& imes);
// Map from input method ID to associated input method descriptor.
typedef std::map<
std::string, InputMethodDescriptor> InputMethodIdToDescriptorMap;
using InputMethodIdToDescriptorMap =
std::map<std::string, InputMethodDescriptor>;
// Returns the fallback input method descriptor (the very basic US
// keyboard). This function is mostly used for testing, but may be used
......@@ -183,7 +183,7 @@ class COMPONENT_EXPORT(UI_BASE_IME_CHROMEOS) InputMethodUtil {
const InputMethodDescriptor& input_method, bool short_name) const;
// 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_;
InputMethodIdToDescriptorMap id_to_descriptor_;
......
......@@ -9,7 +9,7 @@ namespace chromeos {
namespace input_method {
MockComponentExtensionIMEManagerDelegate::
MockComponentExtensionIMEManagerDelegate() {}
MockComponentExtensionIMEManagerDelegate() = default;
MockComponentExtensionIMEManagerDelegate::
~MockComponentExtensionIMEManagerDelegate() = default;
......
......@@ -19,7 +19,7 @@ MockIMEInputContextHandler::MockIMEInputContextHandler()
update_preedit_text_call_count_(0),
delete_surrounding_text_call_count_(0) {}
MockIMEInputContextHandler::~MockIMEInputContextHandler() {}
MockIMEInputContextHandler::~MockIMEInputContextHandler() = default;
void MockIMEInputContextHandler::CommitText(const std::string& text) {
++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