Skip to content

Commit

Permalink
Run clang-tidy modernize-use-equals-default on //ui/views/[flmnprst].*
Browse files Browse the repository at this point in the history
This is a run of
run-clang-tidy.py -checks="-*,modernize-use-equals-default" -header-filter=ui/views/* \\src\\ui\\views\\

BUG=940732
TBR=sky@chromium.org

Change-Id: Ica5c14a7ff31d0fa47719d072dd58462db0b5b51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531232
Reviewed-by: Robert Liao <robliao@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642238}
  • Loading branch information
Robert Liao authored and Commit Bot committed Mar 19, 2019
1 parent 61a2ad2 commit 7edae6d
Show file tree
Hide file tree
Showing 43 changed files with 74 additions and 103 deletions.
4 changes: 2 additions & 2 deletions ui/views/focus/focus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class VIEWS_EXPORT FocusTraversable {
virtual View* GetFocusTraversableParentView() = 0;

protected:
virtual ~FocusTraversable() {}
virtual ~FocusTraversable() = default;
};

// This interface should be implemented by classes that want to be notified when
Expand All @@ -117,7 +117,7 @@ class VIEWS_EXPORT FocusChangeListener {
virtual void OnDidChangeFocus(View* focused_before, View* focused_now) = 0;

protected:
virtual ~FocusChangeListener() {}
virtual ~FocusChangeListener() = default;
};

// FocusManager adds itself as a ViewObserver to the currently focused view.
Expand Down
2 changes: 1 addition & 1 deletion ui/views/focus/focus_manager_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class View;
// Delegate interface for views::FocusManager.
class VIEWS_EXPORT FocusManagerDelegate {
public:
virtual ~FocusManagerDelegate() {}
virtual ~FocusManagerDelegate() = default;

// Activate the target associated with the specified accelerator.
// First, AcceleratorPressed handler of the most recently registered target
Expand Down
8 changes: 4 additions & 4 deletions ui/views/focus/focus_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class FocusManagerDtorTest : public FocusManagerTest {
public:
explicit TestFocusManagerFactory(DtorTrackVector* dtor_tracker)
: dtor_tracker_(dtor_tracker) {}
~TestFocusManagerFactory() override {}
~TestFocusManagerFactory() override = default;

std::unique_ptr<FocusManager> CreateFocusManager(Widget* widget) override {
return std::make_unique<FocusManagerDtorTracked>(widget, dtor_tracker_);
Expand Down Expand Up @@ -627,7 +627,7 @@ class FocusManagerArrowKeyTraversalTest
public testing::WithParamInterface<bool> {
public:
FocusManagerArrowKeyTraversalTest() = default;
~FocusManagerArrowKeyTraversalTest() override {}
~FocusManagerArrowKeyTraversalTest() override = default;

// FocusManagerTest overrides:
void SetUp() override {
Expand Down Expand Up @@ -806,7 +806,7 @@ class AdvanceFocusWidgetDelegate : public WidgetDelegate {
public:
explicit AdvanceFocusWidgetDelegate(Widget* widget)
: widget_(widget), should_advance_focus_to_parent_(false) {}
~AdvanceFocusWidgetDelegate() override {}
~AdvanceFocusWidgetDelegate() override = default;

void set_should_advance_focus_to_parent(bool value) {
should_advance_focus_to_parent_ = value;
Expand All @@ -830,7 +830,7 @@ class TestBubbleDialogDelegateView : public BubbleDialogDelegateView {
public:
TestBubbleDialogDelegateView(View* anchor)
: BubbleDialogDelegateView(anchor, BubbleBorder::NONE) {}
~TestBubbleDialogDelegateView() override {}
~TestBubbleDialogDelegateView() override = default;

// If this is called, the bubble will be forced to use a NativeWidgetAura.
// If not set, it might get a DesktopNativeWidgetAura depending on the
Expand Down
2 changes: 1 addition & 1 deletion ui/views/focus/focus_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class VIEWS_EXPORT FocusSearch {
// needed and you want to check IsAccessibilityFocusable(), rather than
// IsFocusable().
FocusSearch(View* root, bool cycle, bool accessibility_mode);
virtual ~FocusSearch() {}
virtual ~FocusSearch() = default;

// Finds the next view that should be focused and returns it. If a
// FocusTraversable is found while searching for the focusable view,
Expand Down
7 changes: 3 additions & 4 deletions ui/views/focus/focus_traversal_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ class FocusTraversalTest : public FocusManagerTest {
FocusTraversalTest::FocusTraversalTest()
: style_tab_(nullptr), search_border_view_(nullptr) {}

FocusTraversalTest::~FocusTraversalTest() {
}
FocusTraversalTest::~FocusTraversalTest() = default;

void FocusTraversalTest::InitContentView() {
// Create a complicated view hierarchy with lots of control types for
Expand Down Expand Up @@ -809,12 +808,12 @@ TEST_F(FocusTraversalTest, PaneTraversal) {

class FocusTraversalNonFocusableTest : public FocusManagerTest {
public:
~FocusTraversalNonFocusableTest() override {}
~FocusTraversalNonFocusableTest() override = default;

void InitContentView() override;

protected:
FocusTraversalNonFocusableTest() {}
FocusTraversalNonFocusableTest() = default;

private:
DISALLOW_COPY_AND_ASSIGN(FocusTraversalNonFocusableTest);
Expand Down
2 changes: 1 addition & 1 deletion ui/views/focus/widget_focus_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WidgetFocusChangeListener {
virtual void OnNativeFocusChanged(gfx::NativeView focused_now) = 0;

protected:
virtual ~WidgetFocusChangeListener() {}
virtual ~WidgetFocusChangeListener() = default;
};

class VIEWS_EXPORT WidgetFocusManager {
Expand Down
5 changes: 2 additions & 3 deletions ui/views/layout/box_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BoxLayout::ViewWrapper::ViewWrapper(const BoxLayout* layout, View* view)
margins_ = *margins;
}

BoxLayout::ViewWrapper::~ViewWrapper() {}
BoxLayout::ViewWrapper::~ViewWrapper() = default;

int BoxLayout::ViewWrapper::GetHeightForWidth(int width) const {
// When collapse_margins_spacing_ is true, the BoxLayout handles the margin
Expand Down Expand Up @@ -103,8 +103,7 @@ BoxLayout::BoxLayout(BoxLayout::Orientation orientation,
collapse_margins_spacing_(collapse_margins_spacing),
host_(nullptr) {}

BoxLayout::~BoxLayout() {
}
BoxLayout::~BoxLayout() = default;

void BoxLayout::SetFlexForView(const View* view,
int flex_weight,
Expand Down
4 changes: 2 additions & 2 deletions ui/views/layout/fill_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

namespace views {

FillLayout::FillLayout() {}
FillLayout::FillLayout() = default;

FillLayout::~FillLayout() {}
FillLayout::~FillLayout() = default;

void FillLayout::Layout(View* host) {
if (host->children().empty())
Expand Down
2 changes: 1 addition & 1 deletion ui/views/layout/flex_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ bool FlexLayoutInternal::IsLayoutValid(const Layout& cached_layout) const {
FlexLayout::FlexLayout()
: internal_(std::make_unique<internal::FlexLayoutInternal>(this)) {}

FlexLayout::~FlexLayout() {}
FlexLayout::~FlexLayout() = default;

FlexLayout& FlexLayout::SetOrientation(LayoutOrientation orientation) {
if (orientation != orientation_) {
Expand Down
10 changes: 2 additions & 8 deletions ui/views/layout/flex_layout_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,10 @@ FlexSpecification::FlexSpecification(const FlexRule& rule,
int weight)
: rule_(rule), order_(order), weight_(weight) {}

FlexSpecification::FlexSpecification(const FlexSpecification& other)
: rule_(other.rule_), order_(other.order_), weight_(other.weight_) {}
FlexSpecification::FlexSpecification(const FlexSpecification& other) = default;

FlexSpecification& FlexSpecification::operator=(
const FlexSpecification& other) {
rule_ = other.rule_;
order_ = other.order_;
weight_ = other.weight_;
return *this;
}
const FlexSpecification& other) = default;

FlexSpecification::~FlexSpecification() = default;

Expand Down
11 changes: 5 additions & 6 deletions ui/views/layout/grid_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LayoutElement {
DCHECK(resize_percent >= 0);
}

virtual ~LayoutElement() {}
virtual ~LayoutElement() = default;

void SetLocation(int location) {
location_ = location;
Expand Down Expand Up @@ -188,7 +188,7 @@ class Column : public LayoutElement {
is_padding_(is_padding),
master_column_(nullptr) {}

~Column() override {}
~Column() override = default;

GridLayout::Alignment h_align() { return h_align_; }
GridLayout::Alignment v_align() { return v_align_; }
Expand Down Expand Up @@ -281,7 +281,7 @@ class Row : public LayoutElement {
max_descent_(0) {
}

~Row() override {}
~Row() override = default;

void ResetSize() override {
max_ascent_ = max_descent_ = 0;
Expand Down Expand Up @@ -401,8 +401,7 @@ static bool CompareByRowSpan(const std::unique_ptr<ViewState>& v1,

ColumnSet::ColumnSet(int id) : id_(id), linked_column_size_limit_(INT_MAX) {}

ColumnSet::~ColumnSet() {
}
ColumnSet::~ColumnSet() = default;

void ColumnSet::AddPaddingColumn(float resize_percent, int width) {
AddColumn(GridLayout::FILL, GridLayout::FILL, resize_percent,
Expand Down Expand Up @@ -779,7 +778,7 @@ GridLayout::GridLayout(View* host) : host_(host) {
DCHECK(host);
}

GridLayout::~GridLayout() {}
GridLayout::~GridLayout() = default;

ColumnSet* GridLayout::AddColumnSet(int id) {
DCHECK(GetColumnSet(id) == nullptr);
Expand Down
3 changes: 1 addition & 2 deletions ui/views/layout/layout_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

namespace views {

LayoutManager::~LayoutManager() {
}
LayoutManager::~LayoutManager() = default;

void LayoutManager::Installed(View* host) {
}
Expand Down
4 changes: 2 additions & 2 deletions ui/views/masked_targeter_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class View;
// such a mask by extending this class.
class VIEWS_EXPORT MaskedTargeterDelegate : public ViewTargeterDelegate {
public:
MaskedTargeterDelegate() {}
~MaskedTargeterDelegate() override {}
MaskedTargeterDelegate() = default;
~MaskedTargeterDelegate() override = default;

// Sets the hit-test mask for the view which implements this interface,
// in that view's local coordinate space. Returns whether a valid mask
Expand Down
3 changes: 1 addition & 2 deletions ui/views/mouse_watcher_view_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ MouseWatcherViewHost::MouseWatcherViewHost(View* view,
hot_zone_insets_(hot_zone_insets) {
}

MouseWatcherViewHost::~MouseWatcherViewHost() {
}
MouseWatcherViewHost::~MouseWatcherViewHost() = default;

bool MouseWatcherViewHost::Contains(
const gfx::Point& screen_point,
Expand Down
2 changes: 1 addition & 1 deletion ui/views/mus/desktop_window_tree_host_mus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ClientSideNonClientFrameView : public NonClientFrameView,

observed_.Add(window());
}
~ClientSideNonClientFrameView() override {}
~ClientSideNonClientFrameView() override = default;

private:
gfx::Insets GetClientInsets() const {
Expand Down
2 changes: 1 addition & 1 deletion ui/views/mus/mus_client_observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class VIEWS_MUS_EXPORT MusClientObserver {
virtual void OnWindowManagerFrameValuesChanged() = 0;

protected:
virtual ~MusClientObserver() {}
virtual ~MusClientObserver() = default;
};

} // namespace views
Expand Down
2 changes: 1 addition & 1 deletion ui/views/mus/mus_property_mirror.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace views {
// Facilitates copying mus client window properties to their mash frame windows.
class VIEWS_MUS_EXPORT MusPropertyMirror {
public:
virtual ~MusPropertyMirror() {}
virtual ~MusPropertyMirror() = default;

// Called when a property with the given |key| has changed for |window|.
// |window| is what mus clients get when calling |widget->GetNativeWindow()|.
Expand Down
2 changes: 1 addition & 1 deletion ui/views/mus/screen_mus_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class VIEWS_MUS_EXPORT ScreenMusDelegate {
virtual aura::Window* GetWindowAtScreenPoint(const gfx::Point& point) = 0;

protected:
virtual ~ScreenMusDelegate() {}
virtual ~ScreenMusDelegate() = default;
};

} // namespace views
Expand Down
2 changes: 1 addition & 1 deletion ui/views/mus/window_manager_frame_values.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ base::LazyInstance<WindowManagerFrameValues>::Leaky lazy_instance =
WindowManagerFrameValues::WindowManagerFrameValues()
: max_title_bar_button_width(0) {}

WindowManagerFrameValues::~WindowManagerFrameValues() {}
WindowManagerFrameValues::~WindowManagerFrameValues() = default;

// static
void WindowManagerFrameValues::SetInstance(
Expand Down
2 changes: 1 addition & 1 deletion ui/views/native_theme_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace views {
// between 0 and 255 based on the current value of the animation.
class VIEWS_EXPORT NativeThemeDelegate {
public:
virtual ~NativeThemeDelegate() {}
virtual ~NativeThemeDelegate() = default;

// Get the native theme part that should be drawn.
virtual ui::NativeTheme::Part GetThemePart() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion ui/views/paint_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ PaintInfo PaintInfo::CreateChildPaintInfo(const PaintInfo& parent_paint_info,
is_layer);
}

PaintInfo::~PaintInfo() {}
PaintInfo::~PaintInfo() = default;

bool PaintInfo::IsPixelCanvas() const {
return context().is_pixel_canvas();
Expand Down
4 changes: 2 additions & 2 deletions ui/views/paint_info_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ void VerifyPixelSizesAreSameAsDIPSize(const PaintInfos& info_list) {

class PaintInfoTest : public ::testing::Test {
public:
PaintInfoTest() {}
PaintInfoTest() = default;

~PaintInfoTest() override {}
~PaintInfoTest() override = default;

// ___________
// | 1 |
Expand Down
16 changes: 6 additions & 10 deletions ui/views/painter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ SolidRoundRectPainter::SolidRoundRectPainter(SkColor bg_color,
blend_mode_(blend_mode),
antialias_(antialias) {}

SolidRoundRectPainter::~SolidRoundRectPainter() {}
SolidRoundRectPainter::~SolidRoundRectPainter() = default;

gfx::Size SolidRoundRectPainter::GetMinimumSize() const {
return gfx::Size();
Expand Down Expand Up @@ -123,8 +123,7 @@ SolidFocusPainter::SolidFocusPainter(SkColor color,
const gfx::InsetsF& insets)
: color_(color), thickness_(thickness), insets_(insets) {}

SolidFocusPainter::~SolidFocusPainter() {
}
SolidFocusPainter::~SolidFocusPainter() = default;

gfx::Size SolidFocusPainter::GetMinimumSize() const {
return gfx::Size();
Expand Down Expand Up @@ -169,8 +168,7 @@ ImagePainter::ImagePainter(const gfx::ImageSkia& image,
: nine_painter_(new gfx::NineImagePainter(image, insets)) {
}

ImagePainter::~ImagePainter() {
}
ImagePainter::~ImagePainter() = default;

gfx::Size ImagePainter::GetMinimumSize() const {
return nine_painter_->GetMinimumSize();
Expand Down Expand Up @@ -202,7 +200,7 @@ PaintedLayer::PaintedLayer(std::unique_ptr<Painter> painter)
layer()->set_delegate(this);
}

PaintedLayer::~PaintedLayer() {}
PaintedLayer::~PaintedLayer() = default;

void PaintedLayer::OnPaintLayer(const ui::PaintContext& context) {
ui::PaintRecorder recorder(context, layer()->size());
Expand All @@ -217,11 +215,9 @@ void PaintedLayer::OnDeviceScaleFactorChanged(float old_device_scale_factor,

// Painter --------------------------------------------------------------------

Painter::Painter() {
}
Painter::Painter() = default;

Painter::~Painter() {
}
Painter::~Painter() = default;

// static
void Painter::PaintPainterAt(gfx::Canvas* canvas,
Expand Down
3 changes: 1 addition & 2 deletions ui/views/repeat_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ const int kRepeatDelay = 50;
RepeatController::RepeatController(const base::RepeatingClosure& callback)
: callback_(callback) {}

RepeatController::~RepeatController() {
}
RepeatController::~RepeatController() = default;

void RepeatController::Start() {
// The first timer is slightly longer than subsequent repeats.
Expand Down
3 changes: 1 addition & 2 deletions ui/views/round_rect_painter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ RoundRectPainter::RoundRectPainter(SkColor border_color, int corner_radius)
corner_radius_(corner_radius) {
}

RoundRectPainter::~RoundRectPainter() {
}
RoundRectPainter::~RoundRectPainter() = default;

gfx::Size RoundRectPainter::GetMinimumSize() const {
return gfx::Size(1, 1);
Expand Down
2 changes: 1 addition & 1 deletion ui/views/selection_controller_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class VIEWS_EXPORT SelectionControllerDelegate {
virtual void UpdateSelectionClipboard() = 0;

protected:
virtual ~SelectionControllerDelegate() {}
virtual ~SelectionControllerDelegate() = default;
};

} // namespace views
Expand Down
Loading

0 comments on commit 7edae6d

Please sign in to comment.