Commit 4ba4ca35 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=pkotwicz@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#301588}
parent ca3a84f7
...@@ -29,7 +29,7 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton { ...@@ -29,7 +29,7 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton {
static const char kViewClassName[]; static const char kViewClassName[];
FrameCaptionButton(views::ButtonListener* listener, CaptionButtonIcon icon); FrameCaptionButton(views::ButtonListener* listener, CaptionButtonIcon icon);
virtual ~FrameCaptionButton(); ~FrameCaptionButton() override;
// Sets the images to use to paint the button. If |animate| is ANIMATE_YES, // Sets the images to use to paint the button. If |animate| is ANIMATE_YES,
// the button crossfades to the new visuals. If the image ids match those // the button crossfades to the new visuals. If the image ids match those
...@@ -50,9 +50,9 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton { ...@@ -50,9 +50,9 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton {
void SetAlpha(int alpha); void SetAlpha(int alpha);
// views::View overrides: // views::View overrides:
virtual gfx::Size GetPreferredSize() const override; gfx::Size GetPreferredSize() const override;
virtual const char* GetClassName() const override; const char* GetClassName() const override;
virtual void OnPaint(gfx::Canvas* canvas) override; void OnPaint(gfx::Canvas* canvas) override;
void set_paint_as_active(bool paint_as_active) { void set_paint_as_active(bool paint_as_active) {
paint_as_active_ = paint_as_active; paint_as_active_ = paint_as_active;
...@@ -64,7 +64,7 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton { ...@@ -64,7 +64,7 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton {
protected: protected:
// views::CustomButton override: // views::CustomButton override:
virtual void OnGestureEvent(ui::GestureEvent* event) override; void OnGestureEvent(ui::GestureEvent* event) override;
private: private:
// Returns the icon image to paint based on |paint_as_active_|. // Returns the icon image to paint based on |paint_as_active_|.
......
...@@ -35,7 +35,7 @@ class ASH_EXPORT FrameCaptionButtonContainerView ...@@ -35,7 +35,7 @@ class ASH_EXPORT FrameCaptionButtonContainerView
// |frame| is the views::Widget that the caption buttons act on. // |frame| is the views::Widget that the caption buttons act on.
explicit FrameCaptionButtonContainerView(views::Widget* frame); explicit FrameCaptionButtonContainerView(views::Widget* frame);
virtual ~FrameCaptionButtonContainerView(); ~FrameCaptionButtonContainerView() override;
// For testing. // For testing.
class ASH_EXPORT TestApi { class ASH_EXPORT TestApi {
...@@ -91,13 +91,13 @@ class ASH_EXPORT FrameCaptionButtonContainerView ...@@ -91,13 +91,13 @@ class ASH_EXPORT FrameCaptionButtonContainerView
void UpdateSizeButtonVisibility(); void UpdateSizeButtonVisibility();
// views::View: // views::View:
virtual gfx::Size GetPreferredSize() const override; gfx::Size GetPreferredSize() const override;
virtual void Layout() override; void Layout() override;
virtual const char* GetClassName() const override; const char* GetClassName() const override;
// Overridden from gfx::AnimationDelegate: // Overridden from gfx::AnimationDelegate:
virtual void AnimationEnded(const gfx::Animation* animation) override; void AnimationEnded(const gfx::Animation* animation) override;
virtual void AnimationProgressed(const gfx::Animation* animation) override; void AnimationProgressed(const gfx::Animation* animation) override;
private: private:
friend class FrameCaptionButtonContainerViewTest; friend class FrameCaptionButtonContainerViewTest;
...@@ -129,20 +129,18 @@ class ASH_EXPORT FrameCaptionButtonContainerView ...@@ -129,20 +129,18 @@ class ASH_EXPORT FrameCaptionButtonContainerView
bool ShouldSizeButtonBeVisible() const; bool ShouldSizeButtonBeVisible() const;
// views::ButtonListener: // views::ButtonListener:
virtual void ButtonPressed(views::Button* sender, void ButtonPressed(views::Button* sender, const ui::Event& event) override;
const ui::Event& event) override;
// FrameSizeButtonDelegate: // FrameSizeButtonDelegate:
virtual bool IsMinimizeButtonVisible() const override; bool IsMinimizeButtonVisible() const override;
virtual void SetButtonsToNormal(Animate animate) override; void SetButtonsToNormal(Animate animate) override;
virtual void SetButtonIcons(CaptionButtonIcon minimize_button_icon, void SetButtonIcons(CaptionButtonIcon minimize_button_icon,
CaptionButtonIcon close_button_icon, CaptionButtonIcon close_button_icon,
Animate animate) override; Animate animate) override;
virtual const FrameCaptionButton* GetButtonClosestTo( const FrameCaptionButton* GetButtonClosestTo(
const gfx::Point& position_in_screen) const override; const gfx::Point& position_in_screen) const override;
virtual void SetHoveredAndPressedButtons( void SetHoveredAndPressedButtons(const FrameCaptionButton* to_hover,
const FrameCaptionButton* to_hover, const FrameCaptionButton* to_press) override;
const FrameCaptionButton* to_press) override;
// The widget that the buttons act on. // The widget that the buttons act on.
views::Widget* frame_; views::Widget* frame_;
......
...@@ -21,16 +21,11 @@ class TestWidgetDelegate : public views::WidgetDelegateView { ...@@ -21,16 +21,11 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
public: public:
TestWidgetDelegate(bool can_maximize, bool can_minimize) TestWidgetDelegate(bool can_maximize, bool can_minimize)
: can_maximize_(can_maximize), can_minimize_(can_minimize) {} : can_maximize_(can_maximize), can_minimize_(can_minimize) {}
virtual ~TestWidgetDelegate() { ~TestWidgetDelegate() override {}
}
virtual bool CanMaximize() const override { bool CanMaximize() const override { return can_maximize_; }
return can_maximize_;
}
virtual bool CanMinimize() const override { bool CanMinimize() const override { return can_minimize_; }
return can_minimize_;
}
private: private:
bool can_maximize_; bool can_maximize_;
...@@ -56,8 +51,7 @@ class FrameCaptionButtonContainerViewTest : public ash::test::AshTestBase { ...@@ -56,8 +51,7 @@ class FrameCaptionButtonContainerViewTest : public ash::test::AshTestBase {
FrameCaptionButtonContainerViewTest() { FrameCaptionButtonContainerViewTest() {
} }
virtual ~FrameCaptionButtonContainerViewTest() { ~FrameCaptionButtonContainerViewTest() override {}
}
// Creates a widget which allows maximizing based on |maximize_allowed|. // Creates a widget which allows maximizing based on |maximize_allowed|.
// The caller takes ownership of the returned widget. // The caller takes ownership of the returned widget.
......
...@@ -33,15 +33,15 @@ class ASH_EXPORT FrameSizeButton : public FrameCaptionButton { ...@@ -33,15 +33,15 @@ class ASH_EXPORT FrameSizeButton : public FrameCaptionButton {
views::Widget* frame, views::Widget* frame,
FrameSizeButtonDelegate* delegate); FrameSizeButtonDelegate* delegate);
virtual ~FrameSizeButton(); ~FrameSizeButton() override;
// views::CustomButton overrides: // views::CustomButton overrides:
virtual bool OnMousePressed(const ui::MouseEvent& event) override; bool OnMousePressed(const ui::MouseEvent& event) override;
virtual bool OnMouseDragged(const ui::MouseEvent& event) override; bool OnMouseDragged(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override; void OnMouseReleased(const ui::MouseEvent& event) override;
virtual void OnMouseCaptureLost() override; void OnMouseCaptureLost() override;
virtual void OnMouseMoved(const ui::MouseEvent& event) override; void OnMouseMoved(const ui::MouseEvent& event) override;
virtual void OnGestureEvent(ui::GestureEvent* event) override; void OnGestureEvent(ui::GestureEvent* event) override;
void set_delay_to_set_buttons_to_snap_mode(int delay_ms) { void set_delay_to_set_buttons_to_snap_mode(int delay_ms) {
set_buttons_to_snap_mode_delay_ms_ = delay_ms; set_buttons_to_snap_mode_delay_ms_ = delay_ms;
......
...@@ -28,21 +28,13 @@ namespace { ...@@ -28,21 +28,13 @@ namespace {
class TestWidgetDelegate : public views::WidgetDelegateView { class TestWidgetDelegate : public views::WidgetDelegateView {
public: public:
TestWidgetDelegate() {} TestWidgetDelegate() {}
virtual ~TestWidgetDelegate() {} ~TestWidgetDelegate() override {}
// Overridden from views::WidgetDelegate: // Overridden from views::WidgetDelegate:
virtual views::View* GetContentsView() override { views::View* GetContentsView() override { return this; }
return this; bool CanResize() const override { return true; }
} bool CanMaximize() const override { return true; }
virtual bool CanResize() const override { bool CanMinimize() const override { return true; }
return true;
}
virtual bool CanMaximize() const override {
return true;
}
virtual bool CanMinimize() const override {
return true;
}
ash::FrameCaptionButtonContainerView* caption_button_container() { ash::FrameCaptionButtonContainerView* caption_button_container() {
return caption_button_container_; return caption_button_container_;
...@@ -50,7 +42,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView { ...@@ -50,7 +42,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
private: private:
// Overridden from views::View: // Overridden from views::View:
virtual void Layout() override { void Layout() override {
caption_button_container_->Layout(); caption_button_container_->Layout();
// Right align the caption button container. // Right align the caption button container.
...@@ -59,7 +51,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView { ...@@ -59,7 +51,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
preferred_size.width(), preferred_size.height()); preferred_size.width(), preferred_size.height());
} }
virtual void ViewHierarchyChanged( void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override { const ViewHierarchyChangedDetails& details) override {
if (details.is_add && details.child == this) { if (details.is_add && details.child == this) {
caption_button_container_ = caption_button_container_ =
...@@ -91,7 +83,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView { ...@@ -91,7 +83,7 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
class FrameSizeButtonTest : public AshTestBase { class FrameSizeButtonTest : public AshTestBase {
public: public:
FrameSizeButtonTest() {} FrameSizeButtonTest() {}
virtual ~FrameSizeButtonTest() {} ~FrameSizeButtonTest() override {}
// Returns the center point of |view| in screen coordinates. // Returns the center point of |view| in screen coordinates.
gfx::Point CenterPointInScreen(views::View* view) { gfx::Point CenterPointInScreen(views::View* view) {
...@@ -125,7 +117,7 @@ class FrameSizeButtonTest : public AshTestBase { ...@@ -125,7 +117,7 @@ class FrameSizeButtonTest : public AshTestBase {
} }
// AshTestBase overrides: // AshTestBase overrides:
virtual void SetUp() override { void SetUp() override {
AshTestBase::SetUp(); AshTestBase::SetUp();
TestWidgetDelegate* delegate = new TestWidgetDelegate(); TestWidgetDelegate* delegate = new TestWidgetDelegate();
...@@ -407,16 +399,16 @@ TEST_F(FrameSizeButtonTest, SizeButtonPressedWhenSnapButtonHovered) { ...@@ -407,16 +399,16 @@ TEST_F(FrameSizeButtonTest, SizeButtonPressedWhenSnapButtonHovered) {
class FrameSizeButtonTestRTL : public FrameSizeButtonTest { class FrameSizeButtonTestRTL : public FrameSizeButtonTest {
public: public:
FrameSizeButtonTestRTL() {} FrameSizeButtonTestRTL() {}
virtual ~FrameSizeButtonTestRTL() {} ~FrameSizeButtonTestRTL() override {}
virtual void SetUp() override { void SetUp() override {
original_locale_ = l10n_util::GetApplicationLocale(std::string()); original_locale_ = l10n_util::GetApplicationLocale(std::string());
base::i18n::SetICUDefaultLocale("he"); base::i18n::SetICUDefaultLocale("he");
FrameSizeButtonTest::SetUp(); FrameSizeButtonTest::SetUp();
} }
virtual void TearDown() override { void TearDown() override {
FrameSizeButtonTest::TearDown(); FrameSizeButtonTest::TearDown();
base::i18n::SetICUDefaultLocale(original_locale_); base::i18n::SetICUDefaultLocale(original_locale_);
} }
......
...@@ -66,7 +66,7 @@ class CustomFrameViewAshWindowStateDelegate ...@@ -66,7 +66,7 @@ class CustomFrameViewAshWindowStateDelegate
window_state_->AddObserver(this); window_state_->AddObserver(this);
window_state_->window()->AddObserver(this); window_state_->window()->AddObserver(this);
} }
virtual ~CustomFrameViewAshWindowStateDelegate() { ~CustomFrameViewAshWindowStateDelegate() override {
if (window_state_) { if (window_state_) {
window_state_->RemoveObserver(this); window_state_->RemoveObserver(this);
window_state_->window()->RemoveObserver(this); window_state_->window()->RemoveObserver(this);
...@@ -74,7 +74,7 @@ class CustomFrameViewAshWindowStateDelegate ...@@ -74,7 +74,7 @@ class CustomFrameViewAshWindowStateDelegate
} }
private: private:
// Overridden from ash::wm::WindowStateDelegate: // Overridden from ash::wm::WindowStateDelegate:
virtual bool ToggleFullscreen(ash::wm::WindowState* window_state) override { bool ToggleFullscreen(ash::wm::WindowState* window_state) override {
bool enter_fullscreen = !window_state->IsFullscreen(); bool enter_fullscreen = !window_state->IsFullscreen();
if (enter_fullscreen) { if (enter_fullscreen) {
window_state->window()->SetProperty(aura::client::kShowStateKey, window_state->window()->SetProperty(aura::client::kShowStateKey,
...@@ -90,15 +90,14 @@ class CustomFrameViewAshWindowStateDelegate ...@@ -90,15 +90,14 @@ class CustomFrameViewAshWindowStateDelegate
return true; return true;
} }
// Overridden from aura::WindowObserver: // Overridden from aura::WindowObserver:
virtual void OnWindowDestroying(aura::Window* window) override { void OnWindowDestroying(aura::Window* window) override {
window_state_->RemoveObserver(this); window_state_->RemoveObserver(this);
window_state_->window()->RemoveObserver(this); window_state_->window()->RemoveObserver(this);
window_state_ = NULL; window_state_ = NULL;
} }
// Overridden from ash::wm::WindowStateObserver: // Overridden from ash::wm::WindowStateObserver:
virtual void OnPostWindowStateTypeChange( void OnPostWindowStateTypeChange(ash::wm::WindowState* window_state,
ash::wm::WindowState* window_state, ash::wm::WindowStateType old_type) override {
ash::wm::WindowStateType old_type) override {
if (!window_state->IsFullscreen() && if (!window_state->IsFullscreen() &&
!window_state->IsMinimized() && !window_state->IsMinimized() &&
immersive_fullscreen_controller_.get() && immersive_fullscreen_controller_.get() &&
...@@ -132,7 +131,7 @@ class CustomFrameViewAsh::HeaderView ...@@ -132,7 +131,7 @@ class CustomFrameViewAsh::HeaderView
public: public:
// |frame| is the widget that the caption buttons act on. // |frame| is the widget that the caption buttons act on.
explicit HeaderView(views::Widget* frame); explicit HeaderView(views::Widget* frame);
virtual ~HeaderView(); ~HeaderView() override;
// Schedules a repaint for the entire title. // Schedules a repaint for the entire title.
void SchedulePaintForTitle(); void SchedulePaintForTitle();
...@@ -156,13 +155,13 @@ class CustomFrameViewAsh::HeaderView ...@@ -156,13 +155,13 @@ class CustomFrameViewAsh::HeaderView
void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color);
// views::View: // views::View:
virtual void Layout() override; void Layout() override;
virtual void OnPaint(gfx::Canvas* canvas) override; void OnPaint(gfx::Canvas* canvas) override;
virtual void ChildPreferredSizeChanged(views::View* child) override; void ChildPreferredSizeChanged(views::View* child) override;
// ShellObserver: // ShellObserver:
virtual void OnMaximizeModeStarted() override; void OnMaximizeModeStarted() override;
virtual void OnMaximizeModeEnded() override; void OnMaximizeModeEnded() override;
FrameCaptionButtonContainerView* caption_button_container() { FrameCaptionButtonContainerView* caption_button_container() {
return caption_button_container_; return caption_button_container_;
...@@ -174,11 +173,11 @@ class CustomFrameViewAsh::HeaderView ...@@ -174,11 +173,11 @@ class CustomFrameViewAsh::HeaderView
private: private:
// ImmersiveFullscreenController::Delegate: // ImmersiveFullscreenController::Delegate:
virtual void OnImmersiveRevealStarted() override; void OnImmersiveRevealStarted() override;
virtual void OnImmersiveRevealEnded() override; void OnImmersiveRevealEnded() override;
virtual void OnImmersiveFullscreenExited() override; void OnImmersiveFullscreenExited() override;
virtual void SetVisibleFraction(double visible_fraction) override; void SetVisibleFraction(double visible_fraction) override;
virtual std::vector<gfx::Rect> GetVisibleBoundsInScreen() const override; std::vector<gfx::Rect> GetVisibleBoundsInScreen() const override;
// The widget that the caption buttons act on. // The widget that the caption buttons act on.
views::Widget* frame_; views::Widget* frame_;
...@@ -372,15 +371,15 @@ class CustomFrameViewAsh::OverlayView : public views::View, ...@@ -372,15 +371,15 @@ class CustomFrameViewAsh::OverlayView : public views::View,
public views::ViewTargeterDelegate { public views::ViewTargeterDelegate {
public: public:
explicit OverlayView(HeaderView* header_view); explicit OverlayView(HeaderView* header_view);
virtual ~OverlayView(); ~OverlayView() override;
// views::View: // views::View:
virtual void Layout() override; void Layout() override;
private: private:
// views::ViewTargeterDelegate: // views::ViewTargeterDelegate:
virtual bool DoesIntersectRect(const views::View* target, bool DoesIntersectRect(const views::View* target,
const gfx::Rect& rect) const override; const gfx::Rect& rect) const override;
HeaderView* header_view_; HeaderView* header_view_;
......
...@@ -33,7 +33,7 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { ...@@ -33,7 +33,7 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView {
static const char kViewClassName[]; static const char kViewClassName[];
explicit CustomFrameViewAsh(views::Widget* frame); explicit CustomFrameViewAsh(views::Widget* frame);
virtual ~CustomFrameViewAsh(); ~CustomFrameViewAsh() override;
// Inits |immersive_fullscreen_controller| so that the controller reveals // Inits |immersive_fullscreen_controller| so that the controller reveals
// and hides |header_view_| in immersive fullscreen. // and hides |header_view_| in immersive fullscreen.
...@@ -47,25 +47,23 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { ...@@ -47,25 +47,23 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView {
void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color);
// views::NonClientFrameView: // views::NonClientFrameView:
virtual gfx::Rect GetBoundsForClientView() const override; gfx::Rect GetBoundsForClientView() const override;
virtual gfx::Rect GetWindowBoundsForClientBounds( gfx::Rect GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const override; const gfx::Rect& client_bounds) const override;
virtual int NonClientHitTest(const gfx::Point& point) override; int NonClientHitTest(const gfx::Point& point) override;
virtual void GetWindowMask(const gfx::Size& size, void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override;
gfx::Path* window_mask) override; void ResetWindowControls() override;
virtual void ResetWindowControls() override; void UpdateWindowIcon() override;
virtual void UpdateWindowIcon() override; void UpdateWindowTitle() override;
virtual void UpdateWindowTitle() override; void SizeConstraintsChanged() override;
virtual void SizeConstraintsChanged() override;
// views::View: // views::View:
virtual gfx::Size GetPreferredSize() const override; gfx::Size GetPreferredSize() const override;
virtual const char* GetClassName() const override; const char* GetClassName() const override;
virtual gfx::Size GetMinimumSize() const override; gfx::Size GetMinimumSize() const override;
virtual gfx::Size GetMaximumSize() const override; gfx::Size GetMaximumSize() const override;
virtual void SchedulePaintInRect(const gfx::Rect& r) override; void SchedulePaintInRect(const gfx::Rect& r) override;
virtual void VisibilityChanged(views::View* starting_from, void VisibilityChanged(views::View* starting_from, bool is_visible) override;
bool is_visible) override;
// Get the view of the header. // Get the view of the header.
views::View* GetHeaderView(); views::View* GetHeaderView();
...@@ -77,8 +75,8 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView { ...@@ -77,8 +75,8 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView {
friend class TestWidgetConstraintsDelegate; friend class TestWidgetConstraintsDelegate;
// views::NonClientFrameView: // views::NonClientFrameView:
virtual bool DoesIntersectRect(const views::View* target, bool DoesIntersectRect(const views::View* target,
const gfx::Rect& rect) const override; const gfx::Rect& rect) const override;
// Returns the container for the minimize/maximize/close buttons that is held // Returns the container for the minimize/maximize/close buttons that is held
// by the HeaderView. Used in testing. // by the HeaderView. Used in testing.
......
...@@ -24,9 +24,9 @@ namespace ash { ...@@ -24,9 +24,9 @@ namespace ash {
class TestWidgetDelegate : public views::WidgetDelegateView { class TestWidgetDelegate : public views::WidgetDelegateView {
public: public:
TestWidgetDelegate() {} TestWidgetDelegate() {}
virtual ~TestWidgetDelegate() {} ~TestWidgetDelegate() override {}
virtual views::NonClientFrameView* CreateNonClientFrameView( views::NonClientFrameView* CreateNonClientFrameView(
views::Widget* widget) override { views::Widget* widget) override {
custom_frame_view_ = new CustomFrameViewAsh(widget); custom_frame_view_ = new CustomFrameViewAsh(widget);
return custom_frame_view_; return custom_frame_view_;
...@@ -46,31 +46,23 @@ class TestWidgetDelegate : public views::WidgetDelegateView { ...@@ -46,31 +46,23 @@ class TestWidgetDelegate : public views::WidgetDelegateView {
class TestWidgetConstraintsDelegate : public TestWidgetDelegate { class TestWidgetConstraintsDelegate : public TestWidgetDelegate {
public: public:
TestWidgetConstraintsDelegate() {} TestWidgetConstraintsDelegate() {}
virtual ~TestWidgetConstraintsDelegate() {} ~TestWidgetConstraintsDelegate() override {}
// views::View: // views::View:
virtual gfx::Size GetMinimumSize() const override { gfx::Size GetMinimumSize() const override { return minimum_size_; }
return minimum_size_;
}
virtual gfx::Size GetMaximumSize() const override { gfx::Size GetMaximumSize() const override { return maximum_size_; }
return maximum_size_;
}
virtual views::View* GetContentsView() override { views::View* GetContentsView() override {
// Set this instance as the contents view so that the maximum and minimum // Set this instance as the contents view so that the maximum and minimum
// size constraints will be used. // size constraints will be used.
return this; return this;
} }
// views::WidgetDelegate: // views::WidgetDelegate:
virtual bool CanMaximize() const override { bool CanMaximize() const override { return true; }
return true;
}
virtual bool CanMinimize() const override { bool CanMinimize() const override { return true; }
return true;
}
void set_minimum_size(const gfx::Size& min_size) { void set_minimum_size(const gfx::Size& min_size) {
minimum_size_ = min_size; minimum_size_ = min_size;
...@@ -105,7 +97,7 @@ class TestWidgetConstraintsDelegate : public TestWidgetDelegate { ...@@ -105,7 +97,7 @@ class TestWidgetConstraintsDelegate : public TestWidgetDelegate {
class CustomFrameViewAshTest : public test::AshTestBase { class CustomFrameViewAshTest : public test::AshTestBase {
public: public:
CustomFrameViewAshTest() {} CustomFrameViewAshTest() {}
virtual ~CustomFrameViewAshTest() {} ~CustomFrameViewAshTest() override {}
protected: protected:
scoped_ptr<views::Widget> CreateWidget(TestWidgetDelegate* delegate) { scoped_ptr<views::Widget> CreateWidget(TestWidgetDelegate* delegate) {
......
...@@ -32,7 +32,7 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter, ...@@ -32,7 +32,7 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
public gfx::AnimationDelegate { public gfx::AnimationDelegate {
public: public:
DefaultHeaderPainter(); DefaultHeaderPainter();
virtual ~DefaultHeaderPainter(); ~DefaultHeaderPainter() override;
// DefaultHeaderPainter does not take ownership of any of the parameters. // DefaultHeaderPainter does not take ownership of any of the parameters.
void Init(views::Widget* frame, void Init(views::Widget* frame,
...@@ -40,13 +40,13 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter, ...@@ -40,13 +40,13 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
FrameCaptionButtonContainerView* caption_button_container); FrameCaptionButtonContainerView* caption_button_container);
// HeaderPainter overrides: // HeaderPainter overrides:
virtual int GetMinimumHeaderWidth() const override; int GetMinimumHeaderWidth() const override;
virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) override; void PaintHeader(gfx::Canvas* canvas, Mode mode) override;
virtual void LayoutHeader() override; void LayoutHeader() override;
virtual int GetHeaderHeightForPainting() const override; int GetHeaderHeightForPainting() const override;
virtual void SetHeaderHeightForPainting(int height) override; void SetHeaderHeightForPainting(int height) override;
virtual void SchedulePaintForTitle() override; void SchedulePaintForTitle() override;
virtual void UpdateLeftViewXInset(int left_view_x_inset) override; void UpdateLeftViewXInset(int left_view_x_inset) override;
// Sets the left header view for the header. Passing NULL removes the view. // Sets the left header view for the header. Passing NULL removes the view.
void UpdateLeftHeaderView(views::View* left_header_view); void UpdateLeftHeaderView(views::View* left_header_view);
...@@ -59,7 +59,7 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter, ...@@ -59,7 +59,7 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment); FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment);
// gfx::AnimationDelegate override: // gfx::AnimationDelegate override:
virtual void AnimationProgressed(const gfx::Animation* animation) override; void AnimationProgressed(const gfx::Animation* animation) override;
// Paints highlight around the edge of the header for inactive restored // Paints highlight around the edge of the header for inactive restored
// windows. // windows.
......
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