Commit badbf8a7 authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final specifiers.

The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

BUG=417463
R=nona@chromium.org

Review URL: https://codereview.chromium.org/648393006

Cr-Commit-Position: refs/heads/master@{#302051}
parent 1ac52cdd
......@@ -26,19 +26,19 @@ class VIEWS_EXPORT InputMethodBase : public InputMethod,
public FocusChangeListener {
public:
InputMethodBase();
virtual ~InputMethodBase();
~InputMethodBase() override;
// Overridden from InputMethod.
virtual void SetDelegate(internal::InputMethodDelegate* delegate) override;
virtual void Init(Widget* widget) override;
virtual void OnTextInputTypeChanged(View* view) override;
virtual ui::TextInputClient* GetTextInputClient() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual bool IsMock() const override;
void SetDelegate(internal::InputMethodDelegate* delegate) override;
void Init(Widget* widget) override;
void OnTextInputTypeChanged(View* view) override;
ui::TextInputClient* GetTextInputClient() const override;
ui::TextInputType GetTextInputType() const override;
bool IsMock() const override;
// Overridden from FocusChangeListener.
virtual void OnWillChangeFocus(View* focused_before, View* focused) override;
virtual void OnDidChangeFocus(View* focused_before, View* focused) override;
void OnWillChangeFocus(View* focused_before, View* focused) override;
void OnDidChangeFocus(View* focused_before, View* focused) override;
protected:
internal::InputMethodDelegate* delegate() const { return delegate_; }
......
......@@ -21,19 +21,15 @@ namespace views {
class InputMethodBridge::HostObserver : public ui::InputMethodObserver {
public:
explicit HostObserver(InputMethodBridge* bridge);
virtual ~HostObserver();
virtual void OnTextInputTypeChanged(
const ui::TextInputClient* client) override {}
virtual void OnFocus() override {}
virtual void OnBlur() override {}
virtual void OnCaretBoundsChanged(
const ui::TextInputClient* client) override {}
virtual void OnTextInputStateChanged(
const ui::TextInputClient* client) override {}
virtual void OnInputMethodDestroyed(
const ui::InputMethod* input_method) override;
virtual void OnShowImeIfNeeded() override {}
~HostObserver() override;
void OnTextInputTypeChanged(const ui::TextInputClient* client) override {}
void OnFocus() override {}
void OnBlur() override {}
void OnCaretBoundsChanged(const ui::TextInputClient* client) override {}
void OnTextInputStateChanged(const ui::TextInputClient* client) override {}
void OnInputMethodDestroyed(const ui::InputMethod* input_method) override;
void OnShowImeIfNeeded() override {}
private:
InputMethodBridge* bridge_;
......
......@@ -32,60 +32,59 @@ class InputMethodBridge : public InputMethodBase,
InputMethodBridge(internal::InputMethodDelegate* delegate,
ui::InputMethod* host,
bool shared_input_method);
virtual ~InputMethodBridge();
~InputMethodBridge() override;
// Overridden from InputMethod:
virtual void OnFocus() override;
virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) override;
virtual void DispatchKeyEvent(const ui::KeyEvent& key) override;
virtual void OnTextInputTypeChanged(View* view) override;
virtual void OnCaretBoundsChanged(View* view) override;
virtual void CancelComposition(View* view) override;
virtual void OnInputLocaleChanged() override;
virtual std::string GetInputLocale() override;
virtual bool IsActive() override;
virtual bool IsCandidatePopupOpen() const override;
virtual void ShowImeIfNeeded() override;
void OnFocus() override;
void OnBlur() override;
bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) override;
void DispatchKeyEvent(const ui::KeyEvent& key) override;
void OnTextInputTypeChanged(View* view) override;
void OnCaretBoundsChanged(View* view) override;
void CancelComposition(View* view) override;
void OnInputLocaleChanged() override;
std::string GetInputLocale() override;
bool IsActive() override;
bool IsCandidatePopupOpen() const override;
void ShowImeIfNeeded() override;
// Overridden from TextInputClient:
virtual void SetCompositionText(
const ui::CompositionText& composition) override;
virtual void ConfirmCompositionText() override;
virtual void ClearCompositionText() override;
virtual void InsertText(const base::string16& text) override;
virtual void InsertChar(base::char16 ch, int flags) override;
virtual gfx::NativeWindow GetAttachedWindow() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual ui::TextInputMode GetTextInputMode() const override;
virtual int GetTextInputFlags() const override;
virtual bool CanComposeInline() const override;
virtual gfx::Rect GetCaretBounds() const override;
virtual bool GetCompositionCharacterBounds(uint32 index,
gfx::Rect* rect) const override;
virtual bool HasCompositionText() const override;
virtual bool GetTextRange(gfx::Range* range) const override;
virtual bool GetCompositionTextRange(gfx::Range* range) const override;
virtual bool GetSelectionRange(gfx::Range* range) const override;
virtual bool SetSelectionRange(const gfx::Range& range) override;
virtual bool DeleteRange(const gfx::Range& range) override;
virtual bool GetTextFromRange(const gfx::Range& range,
base::string16* text) const override;
virtual void OnInputMethodChanged() override;
virtual bool ChangeTextDirectionAndLayoutAlignment(
void SetCompositionText(const ui::CompositionText& composition) override;
void ConfirmCompositionText() override;
void ClearCompositionText() override;
void InsertText(const base::string16& text) override;
void InsertChar(base::char16 ch, int flags) override;
gfx::NativeWindow GetAttachedWindow() const override;
ui::TextInputType GetTextInputType() const override;
ui::TextInputMode GetTextInputMode() const override;
int GetTextInputFlags() const override;
bool CanComposeInline() const override;
gfx::Rect GetCaretBounds() const override;
bool GetCompositionCharacterBounds(uint32 index,
gfx::Rect* rect) const override;
bool HasCompositionText() const override;
bool GetTextRange(gfx::Range* range) const override;
bool GetCompositionTextRange(gfx::Range* range) const override;
bool GetSelectionRange(gfx::Range* range) const override;
bool SetSelectionRange(const gfx::Range& range) override;
bool DeleteRange(const gfx::Range& range) override;
bool GetTextFromRange(const gfx::Range& range,
base::string16* text) const override;
void OnInputMethodChanged() override;
bool ChangeTextDirectionAndLayoutAlignment(
base::i18n::TextDirection direction) override;
virtual void ExtendSelectionAndDelete(size_t before, size_t after) override;
virtual void EnsureCaretInRect(const gfx::Rect& rect) override;
virtual void OnCandidateWindowShown() override;
virtual void OnCandidateWindowUpdated() override;
virtual void OnCandidateWindowHidden() override;
virtual bool IsEditingCommandEnabled(int command_id) override;
virtual void ExecuteEditingCommand(int command_id) override;
void ExtendSelectionAndDelete(size_t before, size_t after) override;
void EnsureCaretInRect(const gfx::Rect& rect) override;
void OnCandidateWindowShown() override;
void OnCandidateWindowUpdated() override;
void OnCandidateWindowHidden() override;
bool IsEditingCommandEnabled(int command_id) override;
void ExecuteEditingCommand(int command_id) override;
// Overridden from FocusChangeListener.
virtual void OnWillChangeFocus(View* focused_before, View* focused) override;
virtual void OnDidChangeFocus(View* focused_before, View* focused) override;
void OnWillChangeFocus(View* focused_before, View* focused) override;
void OnDidChangeFocus(View* focused_before, View* focused) override;
ui::InputMethod* GetHostInputMethod() const;
......
......@@ -20,24 +20,24 @@ class VIEWS_EXPORT MockInputMethod : public InputMethodBase {
public:
MockInputMethod();
explicit MockInputMethod(internal::InputMethodDelegate* delegate);
virtual ~MockInputMethod();
~MockInputMethod() override;
// Overridden from InputMethod:
virtual void Init(Widget* widget) override;
virtual void OnFocus() override;
virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) override;
virtual void DispatchKeyEvent(const ui::KeyEvent& key) override;
virtual void OnTextInputTypeChanged(View* view) override;
virtual void OnCaretBoundsChanged(View* view) override;
virtual void CancelComposition(View* view) override;
virtual void OnInputLocaleChanged() override;
virtual std::string GetInputLocale() override;
virtual bool IsActive() override;
virtual bool IsCandidatePopupOpen() const override;
virtual void ShowImeIfNeeded() override;
virtual bool IsMock() const override;
void Init(Widget* widget) override;
void OnFocus() override;
void OnBlur() override;
bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) override;
void DispatchKeyEvent(const ui::KeyEvent& key) override;
void OnTextInputTypeChanged(View* view) override;
void OnCaretBoundsChanged(View* view) override;
void CancelComposition(View* view) override;
void OnInputLocaleChanged() override;
std::string GetInputLocale() override;
bool IsActive() override;
bool IsCandidatePopupOpen() const override;
void ShowImeIfNeeded() override;
bool IsMock() const override;
bool focus_changed() const { return focus_changed_; }
bool untranslated_ime_message_called() const {
......@@ -59,7 +59,7 @@ class VIEWS_EXPORT MockInputMethod : public InputMethodBase {
private:
// Overridden from InputMethodBase.
virtual void OnWillChangeFocus(View* focused_before, View* focused) override;
void OnWillChangeFocus(View* focused_before, View* focused) override;
// Clears boolean states defined below.
void ClearStates();
......
......@@ -22,24 +22,24 @@ class NullInputMethod : public InputMethod {
NullInputMethod();
// Overridden from InputMethod:
virtual void SetDelegate(internal::InputMethodDelegate* delegate) override;
virtual void Init(Widget* widget) override;
virtual void OnFocus() override;
virtual void OnBlur() override;
virtual bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) override;
virtual void DispatchKeyEvent(const ui::KeyEvent& key) override;
virtual void OnTextInputTypeChanged(View* view) override;
virtual void OnCaretBoundsChanged(View* view) override;
virtual void CancelComposition(View* view) override;
virtual void OnInputLocaleChanged() override;
virtual std::string GetInputLocale() override;
virtual bool IsActive() override;
virtual ui::TextInputClient* GetTextInputClient() const override;
virtual ui::TextInputType GetTextInputType() const override;
virtual bool IsCandidatePopupOpen() const override;
virtual void ShowImeIfNeeded() override;
virtual bool IsMock() const override;
void SetDelegate(internal::InputMethodDelegate* delegate) override;
void Init(Widget* widget) override;
void OnFocus() override;
void OnBlur() override;
bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
NativeEventResult* result) override;
void DispatchKeyEvent(const ui::KeyEvent& key) override;
void OnTextInputTypeChanged(View* view) override;
void OnCaretBoundsChanged(View* view) override;
void CancelComposition(View* view) override;
void OnInputLocaleChanged() override;
std::string GetInputLocale() override;
bool IsActive() override;
ui::TextInputClient* GetTextInputClient() const override;
ui::TextInputType GetTextInputType() const override;
bool IsCandidatePopupOpen() const override;
void ShowImeIfNeeded() override;
bool IsMock() const override;
private:
DISALLOW_COPY_AND_ASSIGN(NullInputMethod);
......
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