Commit c3217160 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=jochen@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#302646}
parent da52c1a8
......@@ -41,7 +41,7 @@ class ContentSettingImageView : public gfx::AnimationDelegate,
const gfx::FontList& font_list,
SkColor text_color,
SkColor parent_background_color);
virtual ~ContentSettingImageView();
~ContentSettingImageView() override;
// Updates the decoration from the shown WebContents.
void Update(content::WebContents* web_contents);
......@@ -63,20 +63,20 @@ class ContentSettingImageView : public gfx::AnimationDelegate,
static int GetBubbleOuterPadding(bool by_icon);
// gfx::AnimationDelegate:
virtual void AnimationEnded(const gfx::Animation* animation) override;
virtual void AnimationProgressed(const gfx::Animation* animation) override;
virtual void AnimationCanceled(const gfx::Animation* animation) override;
void AnimationEnded(const gfx::Animation* animation) override;
void AnimationProgressed(const gfx::Animation* animation) override;
void AnimationCanceled(const gfx::Animation* animation) override;
// views::View:
virtual gfx::Size GetPreferredSize() const override;
virtual void Layout() override;
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
virtual void OnGestureEvent(ui::GestureEvent* event) override;
virtual void OnPaintBackground(gfx::Canvas* canvas) override;
gfx::Size GetPreferredSize() const override;
void Layout() override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
void OnPaintBackground(gfx::Canvas* canvas) override;
// views::WidgetObserver:
virtual void OnWidgetDestroying(views::Widget* widget) override;
void OnWidgetDestroying(views::Widget* widget) override;
bool background_showing() const {
return slide_animator_.is_animating() || pause_animation_;
......
......@@ -17,13 +17,13 @@ class EVBubbleView : public IconLabelBubbleView {
SkColor text_color,
SkColor parent_background_color,
LocationBarView* parent);
virtual ~EVBubbleView();
~EVBubbleView() override;
// IconLabelBubbleView:
virtual gfx::Size GetMinimumSize() const override;
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
virtual void OnGestureEvent(ui::GestureEvent* event) override;
gfx::Size GetMinimumSize() const override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
// Returns what the minimum size would be if the label text were |text|.
gfx::Size GetMinimumSizeForLabelText(const base::string16& text) const;
......
......@@ -28,14 +28,14 @@ class GeneratedCreditCardBubbleController;
class GeneratedCreditCardView : public LocationBarDecorationView {
public:
explicit GeneratedCreditCardView(LocationBarView::Delegate* delegate);
virtual ~GeneratedCreditCardView();
~GeneratedCreditCardView() override;
void Update();
protected:
// LocationBarDecorationView:
virtual bool CanHandleClick() const override;
virtual void OnClick() override;
bool CanHandleClick() const override;
void OnClick() override;
private:
// Helper to get the GeneratedCreditCardBubbleController associated with the
......
......@@ -38,7 +38,7 @@ class IconLabelBubbleView : public views::View {
SkColor text_color,
SkColor parent_background_color,
bool elide_in_middle);
virtual ~IconLabelBubbleView();
~IconLabelBubbleView() override;
void SetLabel(const base::string16& label);
void SetImage(const gfx::ImageSkia& image);
......@@ -48,10 +48,10 @@ class IconLabelBubbleView : public views::View {
protected:
// views::View:
virtual gfx::Size GetPreferredSize() const override;
virtual void Layout() override;
virtual void OnMouseEntered(const ui::MouseEvent& event) override;
virtual void OnMouseExited(const ui::MouseEvent& event) override;
gfx::Size GetPreferredSize() const override;
void Layout() override;
void OnMouseEntered(const ui::MouseEvent& event) override;
void OnMouseExited(const ui::MouseEvent& event) override;
const gfx::FontList& font_list() const { return label_->font_list(); }
......@@ -66,7 +66,7 @@ class IconLabelBubbleView : public views::View {
static int GetBubbleOuterPadding(bool by_icon);
// views::View:
virtual void OnPaint(gfx::Canvas* canvas) override;
void OnPaint(gfx::Canvas* canvas) override;
int GetPreLabelWidth() const;
......
......@@ -36,15 +36,15 @@ class KeywordHintView : public views::View {
const gfx::FontList& font_list,
SkColor text_color,
SkColor background_color);
virtual ~KeywordHintView();
~KeywordHintView() override;
void SetKeyword(const base::string16& keyword);
base::string16 keyword() const { return keyword_; }
virtual gfx::Size GetPreferredSize() const override;
gfx::Size GetPreferredSize() const override;
// The minimum size is just big enough to show the tab.
virtual gfx::Size GetMinimumSize() const override;
virtual void Layout() override;
gfx::Size GetMinimumSize() const override;
void Layout() override;
private:
views::Label* CreateLabel(const gfx::FontList& font_list,
......
......@@ -20,13 +20,13 @@
class LocationBarDecorationView : public views::ImageView {
public:
LocationBarDecorationView();
virtual ~LocationBarDecorationView();
~LocationBarDecorationView() override;
// views::ImageView:
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
virtual void OnGestureEvent(ui::GestureEvent* event) override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
protected:
// Whether this icon should currently be able to process a mouse click. Called
......
......@@ -138,7 +138,7 @@ class LocationBarView : public LocationBar,
Delegate* delegate,
bool is_popup_mode);
virtual ~LocationBarView();
~LocationBarView() override;
// Initializes the LocationBarView.
void Init();
......@@ -239,22 +239,22 @@ class LocationBarView : public LocationBar,
int* right_margin);
// LocationBar:
virtual void FocusLocation(bool select_all) override;
virtual void Revert() override;
virtual OmniboxView* GetOmniboxView() override;
void FocusLocation(bool select_all) override;
void Revert() override;
OmniboxView* GetOmniboxView() override;
// views::View:
virtual bool HasFocus() const override;
virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual gfx::Size GetPreferredSize() const override;
virtual void Layout() override;
bool HasFocus() const override;
void GetAccessibleState(ui::AXViewState* state) override;
gfx::Size GetPreferredSize() const override;
void Layout() override;
// OmniboxEditController:
virtual void Update(const content::WebContents* contents) override;
virtual void ShowURL() override;
virtual void EndOriginChipAnimations(bool cancel_fade) override;
virtual ToolbarModel* GetToolbarModel() override;
virtual content::WebContents* GetWebContents() override;
void Update(const content::WebContents* contents) override;
void ShowURL() override;
void EndOriginChipAnimations(bool cancel_fade) override;
ToolbarModel* GetToolbarModel() override;
content::WebContents* GetWebContents() override;
// Thickness of the edges of the omnibox background images, in normal mode.
static const int kNormalEdgeThickness;
......@@ -339,76 +339,74 @@ class LocationBarView : public LocationBar,
void ResetShowAnimationAndColors();
// LocationBar:
virtual void ShowFirstRunBubble() override;
virtual GURL GetDestinationURL() const override;
virtual WindowOpenDisposition GetWindowOpenDisposition() const override;
virtual ui::PageTransition GetPageTransition() const override;
virtual void AcceptInput() override;
virtual void FocusSearch() override;
virtual void UpdateContentSettingsIcons() override;
virtual void UpdateManagePasswordsIconAndBubble() override;
virtual void UpdatePageActions() override;
virtual void InvalidatePageActions() override;
virtual void UpdateBookmarkStarVisibility() override;
virtual bool ShowPageActionPopup(const extensions::Extension* extension,
bool grant_active_tab) override;
virtual void UpdateOpenPDFInReaderPrompt() override;
virtual void UpdateGeneratedCreditCardView() override;
virtual void SaveStateToContents(content::WebContents* contents) override;
virtual const OmniboxView* GetOmniboxView() const override;
virtual LocationBarTesting* GetLocationBarForTesting() override;
void ShowFirstRunBubble() override;
GURL GetDestinationURL() const override;
WindowOpenDisposition GetWindowOpenDisposition() const override;
ui::PageTransition GetPageTransition() const override;
void AcceptInput() override;
void FocusSearch() override;
void UpdateContentSettingsIcons() override;
void UpdateManagePasswordsIconAndBubble() override;
void UpdatePageActions() override;
void InvalidatePageActions() override;
void UpdateBookmarkStarVisibility() override;
bool ShowPageActionPopup(const extensions::Extension* extension,
bool grant_active_tab) override;
void UpdateOpenPDFInReaderPrompt() override;
void UpdateGeneratedCreditCardView() override;
void SaveStateToContents(content::WebContents* contents) override;
const OmniboxView* GetOmniboxView() const override;
LocationBarTesting* GetLocationBarForTesting() override;
// LocationBarTesting:
virtual int PageActionCount() override;
virtual int PageActionVisibleCount() override;
virtual ExtensionAction* GetPageAction(size_t index) override;
virtual ExtensionAction* GetVisiblePageAction(size_t index) override;
virtual void TestPageActionPressed(size_t index) override;
virtual bool GetBookmarkStarVisibility() override;
int PageActionCount() override;
int PageActionVisibleCount() override;
ExtensionAction* GetPageAction(size_t index) override;
ExtensionAction* GetVisiblePageAction(size_t index) override;
void TestPageActionPressed(size_t index) override;
bool GetBookmarkStarVisibility() override;
// views::View:
virtual const char* GetClassName() const override;
virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
virtual void OnFocus() override;
virtual void OnPaint(gfx::Canvas* canvas) override;
virtual void PaintChildren(gfx::Canvas* canvas,
const views::CullSet& cull_set) override;
const char* GetClassName() const override;
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void OnFocus() override;
void OnPaint(gfx::Canvas* canvas) override;
void PaintChildren(gfx::Canvas* canvas,
const views::CullSet& cull_set) override;
// views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// views::DragController:
virtual void WriteDragDataForView(View* sender,
const gfx::Point& press_pt,
OSExchangeData* data) override;
virtual int GetDragOperationsForView(View* sender,
const gfx::Point& p) override;
virtual bool CanStartDragForView(View* sender,
const gfx::Point& press_pt,
const gfx::Point& p) override;
void WriteDragDataForView(View* sender,
const gfx::Point& press_pt,
OSExchangeData* data) override;
int GetDragOperationsForView(View* sender, const gfx::Point& p) override;
bool CanStartDragForView(View* sender,
const gfx::Point& press_pt,
const gfx::Point& p) override;
// OmniboxEditController:
virtual void OnChanged() override;
virtual void OnSetFocus() override;
virtual InstantController* GetInstant() override;
virtual const ToolbarModel* GetToolbarModel() const override;
virtual void HideURL() override;
void OnChanged() override;
void OnSetFocus() override;
InstantController* GetInstant() override;
const ToolbarModel* GetToolbarModel() const override;
void HideURL() override;
// DropdownBarHostDelegate:
virtual void SetFocusAndSelection(bool select_all) override;
virtual void SetAnimationOffset(int offset) override;
void SetFocusAndSelection(bool select_all) override;
void SetAnimationOffset(int offset) override;
// gfx::AnimationDelegate:
virtual void AnimationProgressed(const gfx::Animation* animation) override;
virtual void AnimationEnded(const gfx::Animation* animation) override;
void AnimationProgressed(const gfx::Animation* animation) override;
void AnimationEnded(const gfx::Animation* animation) override;
// TemplateURLServiceObserver:
virtual void OnTemplateURLServiceChanged() override;
void OnTemplateURLServiceChanged() override;
// SearchModelObserver:
virtual void ModelChanged(const SearchModel::State& old_state,
const SearchModel::State& new_state) override;
void ModelChanged(const SearchModel::State& old_state,
const SearchModel::State& new_state) override;
// The Browser this LocationBarView is in. Note that at least
// chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser
......
......@@ -16,15 +16,15 @@ class LocationBarView;
class LocationIconView : public views::ImageView {
public:
explicit LocationIconView(LocationBarView* location_bar);
virtual ~LocationIconView();
~LocationIconView() override;
// views::ImageView:
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
bool OnMouseDragged(const ui::MouseEvent& event) override;
// ui::EventHandler:
virtual void OnGestureEvent(ui::GestureEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
// Whether we should show the tooltip for this icon or not.
void ShowTooltip(bool show);
......
......@@ -23,7 +23,7 @@ class OpenPDFInReaderView : public views::ImageView,
public views::WidgetObserver {
public:
OpenPDFInReaderView();
virtual ~OpenPDFInReaderView();
~OpenPDFInReaderView() override;
void Update(content::WebContents* web_contents);
......@@ -31,13 +31,13 @@ class OpenPDFInReaderView : public views::ImageView,
void ShowBubble();
// views::ImageView:
virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
virtual bool OnKeyPressed(const ui::KeyEvent& event) override;
void GetAccessibleState(ui::AXViewState* state) override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
bool OnKeyPressed(const ui::KeyEvent& event) override;
// views::WidgetObserver:
virtual void OnWidgetDestroying(views::Widget* widget) override;
void OnWidgetDestroying(views::Widget* widget) override;
OpenPDFInReaderBubbleView* bubble_;
......
......@@ -50,11 +50,10 @@ class OriginChipExtensionIcon : public extensions::IconImage::Observer {
OriginChipExtensionIcon(LocationIconView* icon_view,
Profile* profile,
const extensions::Extension* extension);
virtual ~OriginChipExtensionIcon();
~OriginChipExtensionIcon() override;
// IconImage::Observer:
virtual void OnExtensionIconImageChanged(
extensions::IconImage* image) override;
void OnExtensionIconImageChanged(extensions::IconImage* image) override;
private:
LocationIconView* icon_view_;
......
......@@ -41,7 +41,7 @@ class OriginChipView : public views::LabelButton,
OriginChipView(LocationBarView* location_bar_view,
Profile* profile,
const gfx::FontList& font_list);
virtual ~OriginChipView();
~OriginChipView() override;
SkColor pressed_text_color() const { return pressed_text_color_; }
SkColor pressed_background_color() const {
......@@ -68,8 +68,8 @@ class OriginChipView : public views::LabelButton,
int WidthFromStartOfLabels() const;
// views::LabelButton:
virtual gfx::Size GetPreferredSize() const override;
virtual void Layout() override;
gfx::Size GetPreferredSize() const override;
void Layout() override;
private:
// Returns the X coordinate the first label should be placed at.
......@@ -79,19 +79,18 @@ class OriginChipView : public views::LabelButton,
void SetBorderImages(const int images[3][9]);
// views::LabelButton:
virtual void AnimationProgressed(const gfx::Animation* animation) override;
virtual void AnimationEnded(const gfx::Animation* animation) override;
virtual void OnPaintBorder(gfx::Canvas* canvas) override;
virtual void StateChanged() override;
void AnimationProgressed(const gfx::Animation* animation) override;
void AnimationEnded(const gfx::Animation* animation) override;
void OnPaintBorder(gfx::Canvas* canvas) override;
void StateChanged() override;
// views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// SafeBrowsingUIManager::Observer:
virtual void OnSafeBrowsingHit(
void OnSafeBrowsingHit(
const SafeBrowsingUIManager::UnsafeResource& resource) override;
virtual void OnSafeBrowsingMatch(
void OnSafeBrowsingMatch(
const SafeBrowsingUIManager::UnsafeResource& resource) override;
LocationBarView* location_bar_view_;
......
......@@ -23,13 +23,13 @@ class PageActionWithBadgeView : public views::View {
PageActionImageView* image_view() { return image_view_; }
// views::View:
virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual gfx::Size GetPreferredSize() const override;
void GetAccessibleState(ui::AXViewState* state) override;
gfx::Size GetPreferredSize() const override;
void UpdateVisibility(content::WebContents* contents);
private:
virtual void Layout() override;
void Layout() override;
// The button this view contains.
PageActionImageView* image_view_;
......
......@@ -14,7 +14,7 @@
class SearchButton : public views::LabelButton {
public:
explicit SearchButton(views::ButtonListener* listener);
virtual ~SearchButton();
~SearchButton() override;
// Updates the search button icon to a search icon if |is_search| is true, or
// a navigation icon otherwise.
......
......@@ -24,11 +24,11 @@ class SelectedKeywordView : public IconLabelBubbleView {
SkColor text_color,
SkColor parent_background_color,
Profile* profile);
virtual ~SelectedKeywordView();
~SelectedKeywordView() override;
virtual gfx::Size GetPreferredSize() const override;
virtual gfx::Size GetMinimumSize() const override;
virtual void Layout() override;
gfx::Size GetPreferredSize() const override;
gfx::Size GetMinimumSize() const override;
void Layout() override;
// The current keyword, or an empty string if no keyword is displayed.
void SetKeyword(const base::string16& keyword);
......
......@@ -13,16 +13,15 @@ class CommandUpdater;
class StarView : public BubbleIconView {
public:
explicit StarView(CommandUpdater* command_updater);
virtual ~StarView();
~StarView() override;
// Toggles the star on or off.
void SetToggled(bool on);
protected:
// BubbleIconView:
virtual bool IsBubbleShowing() const override;
virtual void OnExecuting(
BubbleIconView::ExecuteSource execute_source) override;
bool IsBubbleShowing() const override;
void OnExecuting(BubbleIconView::ExecuteSource execute_source) override;
private:
DISALLOW_COPY_AND_ASSIGN(StarView);
......
......@@ -14,16 +14,15 @@ class CommandUpdater;
class TranslateIconView : public BubbleIconView {
public:
explicit TranslateIconView(CommandUpdater* command_updater);
virtual ~TranslateIconView();
~TranslateIconView() override;
// Toggles the icon on or off.
void SetToggled(bool on);
protected:
// BubbleIconView:
virtual bool IsBubbleShowing() const override;
virtual void OnExecuting(
BubbleIconView::ExecuteSource execute_source) override;
bool IsBubbleShowing() const override;
void OnExecuting(BubbleIconView::ExecuteSource execute_source) override;
private:
DISALLOW_COPY_AND_ASSIGN(TranslateIconView);
......
......@@ -77,7 +77,7 @@ class ZoomBubbleView : public views::BubbleDelegateView,
bool auto_close,
ImmersiveModeController* immersive_mode_controller,
FullscreenController* fullscreen_controller);
virtual ~ZoomBubbleView();
~ZoomBubbleView() override;
// If the bubble is not anchored to a view, places the bubble in the top
// right (left in RTL) of the |screen_bounds| that contain |web_contents_|'s
......@@ -103,32 +103,30 @@ class ZoomBubbleView : public views::BubbleDelegateView,
void StopTimer();
// extensions::IconImage::Observer overrides:
virtual void OnExtensionIconImageChanged(
extensions::IconImage* /* image */) override;
void OnExtensionIconImageChanged(extensions::IconImage* /* image */) override;
// views::View methods.
virtual void OnMouseEntered(const ui::MouseEvent& event) override;
virtual void OnMouseExited(const ui::MouseEvent& event) override;
void OnMouseEntered(const ui::MouseEvent& event) override;
void OnMouseExited(const ui::MouseEvent& event) override;
// ui::EventHandler method.
virtual void OnGestureEvent(ui::GestureEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
// views::ButtonListener method.
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// views::BubbleDelegateView method.
virtual void Init() override;
virtual void WindowClosing() override;
void Init() override;
void WindowClosing() override;
// content::NotificationObserver method.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
// ImmersiveModeController::Observer methods.
virtual void OnImmersiveRevealStarted() override;
virtual void OnImmersiveModeControllerDestroyed() override;
void OnImmersiveRevealStarted() override;
void OnImmersiveModeControllerDestroyed() override;
ZoomBubbleExtensionInfo extension_info_;
......
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