diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 23:07:00 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-01 23:07:00 +0000 |
commit | 3984b4b1edee2b14b0ebd41d31fc9fedfc7a0ef9 (patch) | |
tree | 3ce2aba0fd25d8b37d61e58ae437107594f36d39 | |
parent | 894b4a7c7323f0132f3a9611cfb71fa7eed223ad (diff) | |
download | chromium_src-3984b4b1edee2b14b0ebd41d31fc9fedfc7a0ef9.zip chromium_src-3984b4b1edee2b14b0ebd41d31fc9fedfc7a0ef9.tar.gz chromium_src-3984b4b1edee2b14b0ebd41d31fc9fedfc7a0ef9.tar.bz2 |
Lands http://codereview.chromium.org/449003/show for Thiago:
views: replace the deprecated macro (DISALLOW_EVIL_CONSTRUCTORS).
Use DISALLOW_COPY_AND_ASSIGN instead, also fix some style issues
pointed by lint.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/449075
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33500 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | views/accessibility/view_accessibility.h | 2 | ||||
-rw-r--r-- | views/border.cc | 4 | ||||
-rw-r--r-- | views/controls/button/image_button.h | 4 | ||||
-rw-r--r-- | views/controls/image_view.h | 2 | ||||
-rw-r--r-- | views/controls/message_box_view.h | 8 | ||||
-rw-r--r-- | views/controls/native_control.cc | 6 | ||||
-rw-r--r-- | views/controls/scroll_view.cc | 6 | ||||
-rw-r--r-- | views/controls/scroll_view.h | 8 | ||||
-rw-r--r-- | views/controls/scrollbar/bitmap_scroll_bar.h | 4 | ||||
-rw-r--r-- | views/fill_layout.h | 2 | ||||
-rw-r--r-- | views/focus/external_focus_tracker.h | 2 | ||||
-rw-r--r-- | views/grid_layout.h | 2 | ||||
-rw-r--r-- | views/painter.cc | 2 | ||||
-rw-r--r-- | views/view_unittest.cc | 8 | ||||
-rw-r--r-- | views/widget/root_view.cc | 4 | ||||
-rw-r--r-- | views/widget/root_view.h | 5 | ||||
-rw-r--r-- | views/window/custom_frame_view.h | 6 |
17 files changed, 39 insertions, 36 deletions
diff --git a/views/accessibility/view_accessibility.h b/views/accessibility/view_accessibility.h index 57eb45d..003ce7a 100644 --- a/views/accessibility/view_accessibility.h +++ b/views/accessibility/view_accessibility.h @@ -144,7 +144,7 @@ class ATL_NO_VTABLE ViewAccessibility // Member View needed for view-specific calls. views::View* view_; - DISALLOW_EVIL_CONSTRUCTORS(ViewAccessibility); + DISALLOW_COPY_AND_ASSIGN(ViewAccessibility); }; extern const wchar_t kViewsUninitializeAccessibilityInstance[]; diff --git a/views/border.cc b/views/border.cc index 2e74135..fa47bbb 100644 --- a/views/border.cc +++ b/views/border.cc @@ -24,7 +24,7 @@ class SolidBorder : public Border { SkColor color_; gfx::Insets insets_; - DISALLOW_EVIL_CONSTRUCTORS(SolidBorder); + DISALLOW_COPY_AND_ASSIGN(SolidBorder); }; SolidBorder::SolidBorder(int thickness, SkColor color) @@ -83,7 +83,7 @@ class EmptyBorder : public Border { int bottom_; int right_; - DISALLOW_EVIL_CONSTRUCTORS(EmptyBorder); + DISALLOW_COPY_AND_ASSIGN(EmptyBorder); }; } diff --git a/views/controls/button/image_button.h b/views/controls/button/image_button.h index 654c4a0..6c079fe 100644 --- a/views/controls/button/image_button.h +++ b/views/controls/button/image_button.h @@ -71,7 +71,7 @@ class ImageButton : public CustomButton { //////////////////////////////////////////////////////////////////////////////// class ToggleImageButton : public ImageButton { public: - ToggleImageButton(ButtonListener* listener); + explicit ToggleImageButton(ButtonListener* listener); virtual ~ToggleImageButton(); // Change the toggled state. @@ -104,7 +104,7 @@ class ToggleImageButton : public ImageButton { // this one is shown when toggled. std::wstring toggled_tooltip_text_; - DISALLOW_EVIL_CONSTRUCTORS(ToggleImageButton); + DISALLOW_COPY_AND_ASSIGN(ToggleImageButton); }; } // namespace views diff --git a/views/controls/image_view.h b/views/controls/image_view.h index 17a672e..fe7e711 100644 --- a/views/controls/image_view.h +++ b/views/controls/image_view.h @@ -103,7 +103,7 @@ class ImageView : public View { // The current tooltip text. std::wstring tooltip_text_; - DISALLOW_EVIL_CONSTRUCTORS(ImageView); + DISALLOW_COPY_AND_ASSIGN(ImageView); }; } // namespace views diff --git a/views/controls/message_box_view.h b/views/controls/message_box_view.h index c34e904..71809b5 100644 --- a/views/controls/message_box_view.h +++ b/views/controls/message_box_view.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef VIEWS_CONTROLS_MESSAGE_BOX_VIEW_VIEW_H_ -#define VIEWS_CONTROLS_MESSAGE_BOX_VIEW_VIEW_H_ +#ifndef VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ +#define VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ #include <string> @@ -88,7 +88,7 @@ class MessageBoxView : public views::View { ScopedRunnableMethodFactory<MessageBoxView> focus_grabber_factory_; - DISALLOW_EVIL_CONSTRUCTORS(MessageBoxView); + DISALLOW_COPY_AND_ASSIGN(MessageBoxView); }; -#endif // VIEWS_CONTROLS_MESSAGE_BOX_VIEW_VIEW_H_ +#endif // VIEWS_CONTROLS_MESSAGE_BOX_VIEW_H_ diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc index 69d8670..961066d 100644 --- a/views/controls/native_control.cc +++ b/views/controls/native_control.cc @@ -159,7 +159,7 @@ class NativeControlContainer : public CWindowImpl<NativeControlContainer, NativeControl* parent_; HWND control_; - DISALLOW_EVIL_CONSTRUCTORS(NativeControlContainer); + DISALLOW_COPY_AND_ASSIGN(NativeControlContainer); }; NativeControl::NativeControl() : hwnd_view_(NULL), @@ -320,13 +320,13 @@ void NativeControl::VisibilityChanged(View* starting_from, bool is_visible) { } void NativeControl::SetFixedWidth(int width, Alignment alignment) { - DCHECK(width > 0); + DCHECK_GT(width, 0); fixed_width_ = width; horizontal_alignment_ = alignment; } void NativeControl::SetFixedHeight(int height, Alignment alignment) { - DCHECK(height > 0); + DCHECK_GT(height, 0); fixed_height_ = height; vertical_alignment_ = alignment; } diff --git a/views/controls/scroll_view.cc b/views/controls/scroll_view.cc index 84ce6c7..d484e74 100644 --- a/views/controls/scroll_view.cc +++ b/views/controls/scroll_view.cc @@ -31,7 +31,7 @@ class Viewport : public View { } private: - DISALLOW_EVIL_CONSTRUCTORS(Viewport); + DISALLOW_COPY_AND_ASSIGN(Viewport); }; @@ -338,7 +338,7 @@ void ScrollView::UpdateScrollBarPositions() { } } -// TODO(ACW). We should really use ScrollWindowEx as needed +// TODO(ACW): We should really use ScrollWindowEx as needed void ScrollView::ScrollToPosition(ScrollBar* source, int position) { if (!contents_) return; @@ -503,7 +503,7 @@ FixedRowHeightScrollHelper::FixedRowHeightScrollHelper(int top_margin, : VariableRowHeightScrollHelper(NULL), top_margin_(top_margin), row_height_(row_height) { - DCHECK(row_height > 0); + DCHECK_GT(row_height, 0); } VariableRowHeightScrollHelper::RowInfo diff --git a/views/controls/scroll_view.h b/views/controls/scroll_view.h index 5a578cd..43853ad 100644 --- a/views/controls/scroll_view.h +++ b/views/controls/scroll_view.h @@ -5,6 +5,8 @@ #ifndef VIEWS_CONTROLS_SCROLL_VIEW_H_ #define VIEWS_CONTROLS_SCROLL_VIEW_H_ +#include <string> + #include "views/controls/scrollbar/scroll_bar.h" namespace views { @@ -129,7 +131,7 @@ class ScrollView : public View, // Resize corner. View* resize_corner_; - DISALLOW_EVIL_CONSTRUCTORS(ScrollView); + DISALLOW_COPY_AND_ASSIGN(ScrollView); }; // VariableRowHeightScrollHelper is intended for views that contain rows of @@ -178,7 +180,7 @@ class VariableRowHeightScrollHelper { private: Controller* controller_; - DISALLOW_EVIL_CONSTRUCTORS(VariableRowHeightScrollHelper); + DISALLOW_COPY_AND_ASSIGN(VariableRowHeightScrollHelper); }; // FixedRowHeightScrollHelper is intended for views that contain fixed height @@ -199,7 +201,7 @@ class FixedRowHeightScrollHelper : public VariableRowHeightScrollHelper { int top_margin_; int row_height_; - DISALLOW_EVIL_CONSTRUCTORS(FixedRowHeightScrollHelper); + DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper); }; } // namespace views diff --git a/views/controls/scrollbar/bitmap_scroll_bar.h b/views/controls/scrollbar/bitmap_scroll_bar.h index 1a3bc67..cb6603b 100644 --- a/views/controls/scrollbar/bitmap_scroll_bar.h +++ b/views/controls/scrollbar/bitmap_scroll_bar.h @@ -184,9 +184,9 @@ class BitmapScrollBar : public ScrollBar, // True if the scroll buttons at each end of the scroll bar should be shown. bool show_scroll_buttons_; - DISALLOW_EVIL_CONSTRUCTORS(BitmapScrollBar); + DISALLOW_COPY_AND_ASSIGN(BitmapScrollBar); }; } // namespace views -#endif // #ifndef VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ +#endif // VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ diff --git a/views/fill_layout.h b/views/fill_layout.h index e47a639..89dd5ee 100644 --- a/views/fill_layout.h +++ b/views/fill_layout.h @@ -27,7 +27,7 @@ class FillLayout : public LayoutManager { virtual gfx::Size GetPreferredSize(View* host); private: - DISALLOW_EVIL_CONSTRUCTORS(FillLayout); + DISALLOW_COPY_AND_ASSIGN(FillLayout); }; } // namespace views diff --git a/views/focus/external_focus_tracker.h b/views/focus/external_focus_tracker.h index 22e9b7e..3a15aa1 100644 --- a/views/focus/external_focus_tracker.h +++ b/views/focus/external_focus_tracker.h @@ -68,7 +68,7 @@ class ExternalFocusTracker : public FocusChangeListener { // also do not track changes to parent_view_ itself. View* parent_view_; - DISALLOW_EVIL_CONSTRUCTORS(ExternalFocusTracker); + DISALLOW_COPY_AND_ASSIGN(ExternalFocusTracker); }; } // namespace views diff --git a/views/grid_layout.h b/views/grid_layout.h index 9f07242..cbd4129 100644 --- a/views/grid_layout.h +++ b/views/grid_layout.h @@ -355,4 +355,4 @@ class ColumnSet { } // namespace views -#endif // VIEWS_GRID_LAYOUT_H_ +#endif // VIEWS_GRID_LAYOUT_H_ diff --git a/views/painter.cc b/views/painter.cc index bcc65cd..6c67f9e 100644 --- a/views/painter.cc +++ b/views/painter.cc @@ -51,7 +51,7 @@ class GradientPainter : public Painter { bool horizontal_; SkColor colors_[2]; - DISALLOW_EVIL_CONSTRUCTORS(GradientPainter); + DISALLOW_COPY_AND_ASSIGN(GradientPainter); }; diff --git a/views/view_unittest.cc b/views/view_unittest.cc index a326c12..605d4838 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -121,7 +121,7 @@ class EmptyWindow : public CWindowImpl<EmptyWindow, private: bool empty_paint_; - DISALLOW_EVIL_CONSTRUCTORS(EmptyWindow); + DISALLOW_COPY_AND_ASSIGN(EmptyWindow); }; */ @@ -222,7 +222,7 @@ void TestView::ViewHierarchyChanged(bool is_add, View *parent, View *child) { child_ = child; } -} +} // namespace TEST_F(ViewTest, AddRemoveNotifications) { TestView* v1 = new TestView(); @@ -316,7 +316,7 @@ TEST_F(ViewTest, MouseEvent) { v1->SetBounds(0, 0, 300, 300); TestView* v2 = new TestView(); - v2->SetBounds (100, 100, 100, 100); + v2->SetBounds(100, 100, 100, 100); scoped_ptr<Widget> window(CreateWidget()); #if defined(OS_WIN) @@ -936,7 +936,7 @@ class TestViewWithControls : public View { class SimpleWindowDelegate : public WindowDelegate { public: - SimpleWindowDelegate(View* contents) : contents_(contents) { } + explicit SimpleWindowDelegate(View* contents) : contents_(contents) { } virtual void DeleteDelegate() { delete this; } diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index dd2ad8a..5d2b6e4 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -155,7 +155,7 @@ class ScopedProcessingPaint { private: bool* is_processing_paint_; - DISALLOW_EVIL_CONSTRUCTORS(ScopedProcessingPaint); + DISALLOW_COPY_AND_ASSIGN(ScopedProcessingPaint); }; #endif @@ -559,7 +559,7 @@ View* RootView::FindNextFocusableView(View* starting_view, if (!starting_view) { // Default to the first/last child starting_view = reverse ? GetChildViewAt(GetChildViewCount() - 1) : - GetChildViewAt(0) ; + GetChildViewAt(0); // If there was no starting view, then the one we select is a potential // focus candidate. check_starting_view = true; diff --git a/views/widget/root_view.h b/views/widget/root_view.h index 25ca7a2..dbb480f 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -194,7 +194,6 @@ class RootView : public View, friend class PaintTask; RootView(); - DISALLOW_EVIL_CONSTRUCTORS(RootView); // Convert a point to our current mouse handler. Returns false if the // mouse handler is not connected to a Widget. In that case, the @@ -330,8 +329,10 @@ class RootView : public View, // True if we're currently processing paint. bool is_processing_paint_; #endif + + DISALLOW_COPY_AND_ASSIGN(RootView); }; } // namespace views -#endif // VIEWS_WIDGET_ROOT_VIEW_H_ +#endif // VIEWS_WIDGET_ROOT_VIEW_H_ diff --git a/views/window/custom_frame_view.h b/views/window/custom_frame_view.h index 0ae0050..9de22f0 100644 --- a/views/window/custom_frame_view.h +++ b/views/window/custom_frame_view.h @@ -10,7 +10,7 @@ #include "views/window/window.h" #include "views/window/window_resources.h" -namespace gfx{ +namespace gfx { class Canvas; class Font; class Size; @@ -106,9 +106,9 @@ class CustomFrameView : public NonClientFrameView, static void InitClass(); static gfx::Font* title_font_; - DISALLOW_EVIL_CONSTRUCTORS(CustomFrameView); + DISALLOW_COPY_AND_ASSIGN(CustomFrameView); }; } // namespace views -#endif // #ifndef VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ +#endif // VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ |