Skip to content

Commit

Permalink
Run clang-tidy -fix on ui/views/.
Browse files Browse the repository at this point in the history
The only manual change here was to add NOLINT on a private passkey
constructor that clang-tidy thought should be =deleted (which would
break the compile). All other changes are what clang-tidy and git cl
format autogenerated.

This does not make ui/views/ clang-tidy-clean, but it reduces the size
of the tool's .json output by about 90%.

Bug: none
Change-Id: I527678b41764afbe15d5b9855ac4368b2ac3adad
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005460
Commit-Queue: Robert Liao <robliao@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1067720}
  • Loading branch information
pkasting authored and Chromium LUCI CQ committed Nov 4, 2022
1 parent 99e2f46 commit c0a4105
Show file tree
Hide file tree
Showing 169 changed files with 361 additions and 660 deletions.
6 changes: 2 additions & 4 deletions ui/views/accessibility/ax_aura_obj_cache_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#include "ui/views/widget/unique_widget_ptr.h"
#include "ui/views/widget/widget_delegate.h"

namespace views {
namespace test {
namespace views::test {
namespace {

// This class can be used as a deleter for std::unique_ptr<Widget>
Expand Down Expand Up @@ -382,5 +381,4 @@ TEST_F(AXAuraObjCacheTest, VirtualViews) {
}

} // namespace
} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/accessibility/ax_virtual_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#include "ui/views/win/hwnd_util.h"
#endif

namespace views {
namespace test {
namespace views::test {

namespace {

Expand Down Expand Up @@ -787,5 +786,4 @@ TEST_F(AXVirtualViewTest, GetTargetForEvents) {
}
#endif // BUILDFLAG(IS_WIN)

} // namespace test
} // namespace views
} // namespace views::test
5 changes: 1 addition & 4 deletions ui/views/accessibility/view_accessibility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ std::unique_ptr<ViewAccessibility> ViewAccessibility::Create(View* view) {
#endif

ViewAccessibility::ViewAccessibility(View* view)
: view_(view),
focused_virtual_child_(nullptr),
is_leaf_(false),
is_ignored_(false) {
: view_(view), focused_virtual_child_(nullptr) {
#if defined(USE_AURA) && !BUILDFLAG(IS_CHROMEOS_ASH)
if (features::IsAccessibilityTreeForViewsEnabled()) {
Widget* widget = view_->GetWidget();
Expand Down
4 changes: 2 additions & 2 deletions ui/views/accessibility/view_accessibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class VIEWS_EXPORT ViewAccessibility {

// If set to true, anything that is a descendant of this view will be hidden
// from accessibility.
bool is_leaf_;
bool is_leaf_ = false;

// When true the view is ignored when generating the AX node hierarchy, but
// its children are included. For example, if you created a custom table with
Expand All @@ -338,7 +338,7 @@ class VIEWS_EXPORT ViewAccessibility {
// ignored, like a Widget's RootView, ClientView, etc.
// Similar to setting the role of an ARIA widget to "none" or
// "presentational".
bool is_ignored_;
bool is_ignored_ = false;

// Used to override the View's enabled state in case we need to mark the View
// as enabled or disabled only in the accessibility tree.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/unique_widget_ptr.h"

namespace views {
namespace test {
namespace views::test {

class ViewAXPlatformNodeDelegateAuraLinuxTest : public ViewsTestBase {
public:
Expand Down Expand Up @@ -170,5 +169,4 @@ TEST_F(ViewAXPlatformNodeDelegateAuraLinuxTest, IndexInParent) {
EXPECT_EQ(-1, atk_object_get_index_in_parent(atk_object));
}

} // namespace test
} // namespace views
} // namespace views::test
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
#include "ui/views/widget/unique_widget_ptr.h"
#include "ui/views/widget/widget.h"

namespace views {
namespace test {
namespace views::test {

namespace {

Expand Down Expand Up @@ -1138,5 +1137,4 @@ TEST_F(AXViewTest, LayoutCalledInvalidateRootView) {
}
#endif

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/accessibility/views_ax_tree_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
#include "ui/views/widget/unique_widget_ptr.h"
#include "ui/views/widget/widget.h"

namespace views {
namespace test {
namespace views::test {

namespace {

Expand Down Expand Up @@ -250,5 +249,4 @@ TEST_P(ViewsAXTreeManagerTest, MultipleTopLevelWidgets) {
second_widget->Show();
}

} // namespace test
} // namespace views
} // namespace views::test
4 changes: 2 additions & 2 deletions ui/views/accessibility/widget_ax_tree_id_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace views {

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

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

// static
WidgetAXTreeIDMap& WidgetAXTreeIDMap::GetInstance() {
Expand Down
6 changes: 2 additions & 4 deletions ui/views/animation/compositor_animation_runner_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include "ui/views/buildflags.h"
#include "ui/views/test/widget_test.h"

namespace views {
namespace test {
namespace views::test {
namespace {
constexpr base::TimeDelta kDuration = base::Milliseconds(100);
}
Expand Down Expand Up @@ -197,5 +196,4 @@ TEST_F(CompositorAnimationRunnerDesktopTest, SwitchCompositor) {
}
#endif

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "ui/gfx/geometry/size.h"
#include "ui/views/animation/test/flood_fill_ink_drop_ripple_test_api.h"

namespace views {
namespace test {
namespace views::test {

TEST(FloodFillInkDropRippleTest, TransformedCenterPointForIrregularClipBounds) {
const gfx::Size host_size(48, 50);
Expand Down Expand Up @@ -143,5 +142,4 @@ TEST(FloodFillInkDropRippleTest, TransformIsPixelAligned) {
}
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/ink_drop_highlight_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#include "ui/views/animation/test/ink_drop_highlight_test_api.h"
#include "ui/views/animation/test/test_ink_drop_highlight_observer.h"

namespace views {
namespace test {
namespace views::test {

class InkDropHighlightTest : public testing::Test {
public:
Expand Down Expand Up @@ -231,5 +230,4 @@ TEST_F(InkDropHighlightTest, TransformIsPixelAligned) {
}
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/ink_drop_host_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
#include "ui/views/animation/test/test_ink_drop.h"
#include "ui/views/controls/highlight_path_generator.h"

namespace views {
namespace test {
namespace views::test {
using InkDropMode = InkDropHostTestApi::InkDropMode;

class TestViewWithInkDrop : public View {
Expand Down Expand Up @@ -360,5 +359,4 @@ TEST_F(InkDropHostViewClippingTest,
EXPECT_TRUE(GetRootLayer()->clip_rect().IsEmpty());
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/ink_drop_ripple_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#include "ui/views/animation/test/square_ink_drop_ripple_test_api.h"
#include "ui/views/animation/test/test_ink_drop_ripple_observer.h"

namespace views {
namespace test {
namespace views::test {

const float kVisibleOpacity = 0.175f;

Expand Down Expand Up @@ -408,5 +407,4 @@ TEST_P(InkDropRippleTest, RipplePendingToActivatedObserverOrder) {
{InkDropState::ACTION_PENDING, InkDropState::ACTIVATED}));
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/ink_drop_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
#include "ui/views/animation/ink_drop_stub.h"
#include "ui/views/animation/test/test_ink_drop_host.h"

namespace views {
namespace test {
namespace views::test {

// Enumeration of all the different InkDrop types.
enum InkDropType { INK_DROP_STUB, INK_DROP_IMPL };
Expand Down Expand Up @@ -134,5 +133,4 @@ TEST_P(InkDropTest, TypicalSlowActivated) {
EXPECT_EQ(InkDropState::HIDDEN, ink_drop_->GetTargetInkDropState());
}

} // namespace test
} // namespace views
} // namespace views::test
3 changes: 1 addition & 2 deletions ui/views/animation/square_ink_drop_ripple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ SquareInkDropRipple::SquareInkDropRipple(const gfx::Size& large_size,
const gfx::Point& center_point,
SkColor color,
float visible_opacity)
: activated_shape_(ActivatedShape::kRoundedRect),
visible_opacity_(visible_opacity),
: visible_opacity_(visible_opacity),
large_size_(large_size),
large_corner_radius_(large_corner_radius),
small_size_(small_size),
Expand Down
2 changes: 1 addition & 1 deletion ui/views/animation/square_ink_drop_ripple.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class VIEWS_EXPORT SquareInkDropRipple : public InkDropRipple {
void OnLayerAnimationSequenceScheduled(ui::LayerAnimationSequence* sequence);

// The shape used for the ACTIVATED/DEACTIVATED states.
ActivatedShape activated_shape_;
ActivatedShape activated_shape_ = ActivatedShape::kRoundedRect;

// Ink drop opacity when it is visible.
float visible_opacity_;
Expand Down
6 changes: 2 additions & 4 deletions ui/views/animation/square_ink_drop_ripple_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#include "ui/views/animation/test/test_ink_drop_ripple_observer.h"
#include "ui/views/test/widget_test.h"

namespace views {
namespace test {
namespace views::test {

namespace {

Expand Down Expand Up @@ -288,5 +287,4 @@ TEST_F(SquareInkDropRippleCalculateTransformsTest, RippleIsPixelAligned) {
widget->CloseNow();
}

} // namespace test
} // namespace views
} // namespace views::test
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/views/animation/ink_drop_ripple.h"

namespace views {
namespace test {
namespace views::test {

FloodFillInkDropRippleTestApi::FloodFillInkDropRippleTestApi(
FloodFillInkDropRipple* ink_drop_ripple)
Expand Down Expand Up @@ -55,5 +54,4 @@ FloodFillInkDropRippleTestApi::GetLayerAnimators() {
return animators;
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/test/flood_fill_ink_drop_ripple_test_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ namespace ui {
class LayerAnimator;
} // namespace ui

namespace views {
namespace test {
namespace views::test {

// Test API to provide internal access to a FloodFillInkDropRipple.
class FloodFillInkDropRippleTestApi : public InkDropRippleTestApi {
Expand Down Expand Up @@ -63,7 +62,6 @@ class FloodFillInkDropRippleTestApi : public InkDropRippleTestApi {
}
};

} // namespace test
} // namespace views
} // namespace views::test

#endif // UI_VIEWS_ANIMATION_TEST_FLOOD_FILL_INK_DROP_RIPPLE_TEST_API_H_
6 changes: 2 additions & 4 deletions ui/views/animation/test/ink_drop_highlight_test_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "ui/compositor/test/layer_animator_test_controller.h"
#include "ui/views/animation/ink_drop_highlight.h"

namespace views {
namespace test {
namespace views::test {

InkDropHighlightTestApi::InkDropHighlightTestApi(
InkDropHighlight* ink_drop_highlight)
Expand All @@ -30,5 +29,4 @@ gfx::Transform InkDropHighlightTestApi::CalculateTransform() {
return ink_drop_highlight()->CalculateTransform();
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/test/ink_drop_host_view_test_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

#include <utility>

namespace views {
namespace test {
namespace views::test {

InkDropHostTestApi::InkDropHostTestApi(InkDropHost* ink_drop_host)
: ink_drop_host_(ink_drop_host) {}
Expand Down Expand Up @@ -44,5 +43,4 @@ void InkDropHostTestApi::AnimateToState(InkDropState state,
ink_drop_host_->AnimateToState(state, event);
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/test/ink_drop_host_view_test_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_host_view.h"

namespace views {
namespace test {
namespace views::test {

// Test API to provide internal access to an InkDropHost instance.
class InkDropHostTestApi {
Expand Down Expand Up @@ -56,7 +55,6 @@ class InkDropHostTestApi {
raw_ptr<InkDropHost, DanglingUntriaged> ink_drop_host_;
};

} // namespace test
} // namespace views
} // namespace views::test

#endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_HOST_VIEW_TEST_API_H_
6 changes: 2 additions & 4 deletions ui/views/animation/test/ink_drop_impl_test_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include "ui/views/animation/test/ink_drop_highlight_test_api.h"
#include "ui/views/animation/test/ink_drop_ripple_test_api.h"

namespace views {
namespace test {
namespace views::test {

//
// AccessFactoryOnExitHighlightState
Expand Down Expand Up @@ -148,5 +147,4 @@ std::vector<ui::LayerAnimator*> InkDropImplTestApi::GetLayerAnimators() {
return animators;
}

} // namespace test
} // namespace views
} // namespace views::test
6 changes: 2 additions & 4 deletions ui/views/animation/test/ink_drop_ripple_test_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

#include "ui/views/animation/test/ink_drop_ripple_test_api.h"

namespace views {
namespace test {
namespace views::test {

InkDropRippleTestApi::InkDropRippleTestApi(InkDropRipple* ink_drop_ripple)
: ui::test::MultiLayerAnimatorTestController(this),
Expand All @@ -17,5 +16,4 @@ std::vector<ui::LayerAnimator*> InkDropRippleTestApi::GetLayerAnimators() {
return std::vector<ui::LayerAnimator*>();
}

} // namespace test
} // namespace views
} // namespace views::test

0 comments on commit c0a4105

Please sign in to comment.