diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 19:13:13 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-14 19:13:13 +0000 |
commit | f71e72699d8535e85fc47c6c2b63f84f796bef71 (patch) | |
tree | b01d1d452ee5a460326a2cbfa642d876830d2120 /views | |
parent | 957b7b518251ba16abca74ff04e370564a826a74 (diff) | |
download | chromium_src-f71e72699d8535e85fc47c6c2b63f84f796bef71.zip chromium_src-f71e72699d8535e85fc47c6c2b63f84f796bef71.tar.gz chromium_src-f71e72699d8535e85fc47c6c2b63f84f796bef71.tar.bz2 |
Remove even more ATL dependencies.
Review URL: http://codereview.chromium.org/115309
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
23 files changed, 112 insertions, 88 deletions
diff --git a/views/controls/button/button_dropdown.cc b/views/controls/button/button_dropdown.cc index 270894b..157caf0 100644 --- a/views/controls/button/button_dropdown.cc +++ b/views/controls/button/button_dropdown.cc @@ -5,6 +5,7 @@ #include "views/controls/button/button_dropdown.h" #include "app/l10n_util.h" +#include "base/compiler_specific.h" #include "base/message_loop.h" #include "grit/generated_resources.h" #include "views/controls/menu/view_menu_delegate.h" @@ -26,7 +27,7 @@ ButtonDropDown::ButtonDropDown(ButtonListener* listener, : ImageButton(listener), menu_delegate_(menu_delegate), y_position_on_lbuttondown_(0), - show_menu_factory_(this) { + ALLOW_THIS_IN_INITIALIZER_LIST(show_menu_factory_(this)) { } ButtonDropDown::~ButtonDropDown() { diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc index 993cd9b..6dbf4ae 100644 --- a/views/controls/button/menu_button.cc +++ b/views/controls/button/menu_button.cc @@ -110,7 +110,7 @@ int MenuButton::GetMaximumScreenXCoordinate() { } HWND hwnd = widget->GetNativeView(); - CRect t; + RECT t; ::GetWindowRect(hwnd, &t); gfx::Rect r(t); @@ -154,8 +154,7 @@ bool MenuButton::Activate() { GetRootView()->SetMouseHandler(NULL); menu_visible_ = true; - menu_delegate_->RunMenu(this, menu_position.ToPOINT(), - GetWidget()->GetNativeView()); + menu_delegate_->RunMenu(this, menu_position, GetWidget()->GetNativeView()); menu_visible_ = false; menu_closed_time_ = Time::Now(); diff --git a/views/controls/button/native_button_win.cc b/views/controls/button/native_button_win.cc index 6748241..5dd70d3 100644 --- a/views/controls/button/native_button_win.cc +++ b/views/controls/button/native_button_win.cc @@ -4,6 +4,8 @@ #include "views/controls/button/native_button_win.h" +#include <commctrl.h> + #include "base/logging.h" #include "views/controls/button/checkbox.h" #include "views/controls/button/native_button.h" diff --git a/views/controls/hwnd_view.cc b/views/controls/hwnd_view.cc index 677e60a..fdf4042 100644 --- a/views/controls/hwnd_view.cc +++ b/views/controls/hwnd_view.cc @@ -110,9 +110,10 @@ void HWNDView::ShowWidget(int x, int y, int w, int h) { if (fast_resize()) { // In a fast resize, we move the window and clip it with SetWindowRgn. - CRect rect; - GetWindowRect(native_view(), &rect); - ::SetWindowPos(native_view(), 0, x, y, rect.Width(), rect.Height(), + RECT win_rect; + GetWindowRect(native_view(), &win_rect); + gfx::Rect rect(win_rect); + ::SetWindowPos(native_view(), 0, x, y, rect.width(), rect.height(), swp_flags); HRGN clip_region = CreateRectRgn(0, 0, w, h); diff --git a/views/controls/menu/view_menu_delegate.h b/views/controls/menu/view_menu_delegate.h index bb72ed3..3d6887b 100644 --- a/views/controls/menu/view_menu_delegate.h +++ b/views/controls/menu/view_menu_delegate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,10 @@ #include "base/gfx/native_widget_types.h" +namespace gfx { +class Point; +} + namespace views { class View; @@ -25,7 +29,7 @@ class ViewMenuDelegate { // Create and show a menu at the specified position. Source is the view the // ViewMenuDelegate was set on. virtual void RunMenu(View* source, - const CPoint& pt, + const gfx::Point& pt, gfx::NativeView hwnd) = 0; }; diff --git a/views/controls/message_box_view.cc b/views/controls/message_box_view.cc index e0cf055..2ac20af 100644 --- a/views/controls/message_box_view.cc +++ b/views/controls/message_box_view.cc @@ -30,7 +30,7 @@ MessageBoxView::MessageBoxView(int dialog_flags, icon_(NULL), checkbox_(NULL), message_width_(message_width), - focus_grabber_factory_(this) { + ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) { Init(dialog_flags, default_prompt); } @@ -42,7 +42,7 @@ MessageBoxView::MessageBoxView(int dialog_flags, icon_(NULL), checkbox_(NULL), message_width_(kDefaultMessageWidth), - focus_grabber_factory_(this) { + ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) { Init(dialog_flags, default_prompt); } diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc index ce37193..6b0b7df 100644 --- a/views/controls/native_control.cc +++ b/views/controls/native_control.cc @@ -8,6 +8,7 @@ #include <atlapp.h> #include <atlcrack.h> #include <atlframe.h> +#include <atlmisc.h> #include "app/l10n_util_win.h" #include "base/logging.h" @@ -127,7 +128,7 @@ class NativeControlContainer : public CWindowImpl<NativeControlContainer, TRACK_HWND_DESTRUCTION(m_hWnd); } - void OnContextMenu(HWND window, const CPoint& location) { + void OnContextMenu(HWND window, const WTL::CPoint& location) { if (parent_) parent_->OnContextMenu(location); } diff --git a/views/controls/native_control.h b/views/controls/native_control.h index 0573168..39022a2 100644 --- a/views/controls/native_control.h +++ b/views/controls/native_control.h @@ -9,6 +9,10 @@ #include "views/view.h" +namespace WTL { +class CPoint; +} + namespace views { class HWNDView; @@ -53,7 +57,7 @@ class NativeControl : public View { virtual LRESULT OnCommand(UINT code, int id, HWND source) { return 0; } // Invoked when the appropriate gesture for a context menu is issued. - virtual void OnContextMenu(const CPoint& location); + virtual void OnContextMenu(const WTL::CPoint& location); // Overridden so to set the native focus to the native control. virtual void Focus(); diff --git a/views/controls/scrollbar/bitmap_scroll_bar.cc b/views/controls/scrollbar/bitmap_scroll_bar.cc index e484517..18096fb 100644 --- a/views/controls/scrollbar/bitmap_scroll_bar.cc +++ b/views/controls/scrollbar/bitmap_scroll_bar.cc @@ -6,6 +6,7 @@ #include "app/gfx/chrome_canvas.h" #include "app/l10n_util.h" +#include "base/compiler_specific.h" #include "base/message_loop.h" #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -37,8 +38,9 @@ class AutorepeatButton : public ImageButton { public: AutorepeatButton(ButtonListener* listener) : ImageButton(listener), - repeater_(NewCallback<AutorepeatButton>(this, - &AutorepeatButton::NotifyClick)) { + ALLOW_THIS_IN_INITIALIZER_LIST(repeater_( + NewCallback<AutorepeatButton>(this, + &AutorepeatButton::NotifyClick))) { } virtual ~AutorepeatButton() {} @@ -255,13 +257,14 @@ class BitmapScrollBarThumb : public View { BitmapScrollBar::BitmapScrollBar(bool horizontal, bool show_scroll_buttons) : contents_size_(0), contents_scroll_offset_(0), - prev_button_(new AutorepeatButton(this)), - next_button_(new AutorepeatButton(this)), - thumb_(new BitmapScrollBarThumb(this)), + ALLOW_THIS_IN_INITIALIZER_LIST(prev_button_(new AutorepeatButton(this))), + ALLOW_THIS_IN_INITIALIZER_LIST(next_button_(new AutorepeatButton(this))), + ALLOW_THIS_IN_INITIALIZER_LIST(thumb_(new BitmapScrollBarThumb(this))), thumb_track_state_(CustomButton::BS_NORMAL), last_scroll_amount_(SCROLL_NONE), - repeater_(NewCallback<BitmapScrollBar>(this, - &BitmapScrollBar::TrackClicked)), + ALLOW_THIS_IN_INITIALIZER_LIST(repeater_( + NewCallback<BitmapScrollBar>(this, + &BitmapScrollBar::TrackClicked))), context_menu_mouse_position_(0), show_scroll_buttons_(show_scroll_buttons), ScrollBar(horizontal) { diff --git a/views/controls/table/group_table_view.cc b/views/controls/table/group_table_view.cc index 5e6a155..b5d5698 100644 --- a/views/controls/table/group_table_view.cc +++ b/views/controls/table/group_table_view.cc @@ -5,6 +5,7 @@ #include "views/controls/table/group_table_view.h" #include "app/gfx/chrome_canvas.h" +#include "base/compiler_specific.h" #include "base/message_loop.h" #include "base/task.h" @@ -24,7 +25,7 @@ GroupTableView::GroupTableView(GroupTableModel* model, : TableView(model, columns, table_type, false, resizable_columns, autosize_columns), model_(model), - sync_selection_factory_(this) { + ALLOW_THIS_IN_INITIALIZER_LIST(sync_selection_factory_(this)) { } GroupTableView::~GroupTableView() { @@ -165,22 +166,22 @@ void GroupTableView::OnSelectedStateChanged() { // Draws the line separator betweens the groups. void GroupTableView::PostPaint(int model_row, int column, bool selected, - const CRect& bounds, HDC hdc) { + const gfx::Rect& bounds, HDC hdc) { GroupRange group_range; model_->GetGroupRangeForItem(model_row, &group_range); // We always paint a vertical line at the end of the last cell. HPEN hPen = CreatePen(PS_SOLID, kSeparatorLineThickness, kSeparatorLineColor); HPEN hPenOld = (HPEN) SelectObject(hdc, hPen); - int x = static_cast<int>(bounds.right - kSeparatorLineThickness); - MoveToEx(hdc, x, bounds.top, NULL); - LineTo(hdc, x, bounds.bottom); + int x = static_cast<int>(bounds.right() - kSeparatorLineThickness); + MoveToEx(hdc, x, bounds.y(), NULL); + LineTo(hdc, x, bounds.bottom()); // We paint a separator line after the last item of a group. if (model_row == (group_range.start + group_range.length - 1)) { - int y = static_cast<int>(bounds.bottom - kSeparatorLineThickness); + int y = static_cast<int>(bounds.bottom() - kSeparatorLineThickness); MoveToEx(hdc, 0, y, NULL); - LineTo(hdc, bounds.Width(), y); + LineTo(hdc, bounds.width(), y); } SelectObject(hdc, hPenOld); DeleteObject(hPen); diff --git a/views/controls/table/group_table_view.h b/views/controls/table/group_table_view.h index d128759..e581d5d 100644 --- a/views/controls/table/group_table_view.h +++ b/views/controls/table/group_table_view.h @@ -48,7 +48,7 @@ class GroupTableView : public TableView { // Extra-painting required to draw the separator line between groups. virtual bool ImplementPostPaint() { return true; } virtual void PostPaint(int model_row, int column, bool selected, - const CRect& bounds, HDC device_context); + const gfx::Rect& bounds, HDC device_context); // In order to make keyboard navigation possible (using the Up and Down // keys), we must take action when an arrow key is pressed. The reason we diff --git a/views/controls/table/table_view.cc b/views/controls/table/table_view.cc index 10c0456..a476da3 100644 --- a/views/controls/table/table_view.cc +++ b/views/controls/table/table_view.cc @@ -4,8 +4,12 @@ #include "views/controls/table/table_view.h" -#include <algorithm> #include <windowsx.h> +#include <atlbase.h> +#include <atlapp.h> +#include <atlmisc.h> + +#include <algorithm> #include "app/gfx/chrome_canvas.h" #include "app/gfx/favicon_size.h" @@ -95,7 +99,7 @@ TableView::TableView(TableModel* model, list_view_(NULL), header_original_handler_(NULL), original_handler_(NULL), - table_view_wrapper_(this), + ALLOW_THIS_IN_INITIALIZER_LIST(table_view_wrapper_(this)), custom_cell_font_(NULL), content_offset_(0) { for (std::vector<TableColumn>::const_iterator i = columns.begin(); @@ -574,10 +578,10 @@ LRESULT CALLBACK TableView::TableWndProc(HWND window, // the position supplied in the l_param. if (table_view->UILayoutIsRightToLeft() && (GET_X_LPARAM(l_param) != -1 || GET_Y_LPARAM(l_param) != -1)) { - CPoint screen_point; + WTL::CPoint screen_point; GetCursorPos(&screen_point); - CPoint table_point = screen_point; - CRect client_rect; + WTL::CPoint table_point = screen_point; + WTL::CRect client_rect; if (ScreenToClient(window, &table_point) && GetClientRect(window, &client_rect) && client_rect.PtInRect(table_point)) { @@ -1231,11 +1235,11 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { SkBitmap image = model_->GetIcon(model_index); if (!image.isNull()) { // Get the rect that holds the icon. - CRect icon_rect, client_rect; + WTL::CRect icon_rect, client_rect; if (ListView_GetItemRect(list_view_, view_index, &icon_rect, LVIR_ICON) && GetClientRect(list_view_, &client_rect)) { - CRect intersection; + WTL::CRect intersection; // Client rect includes the header but we need to make sure we don't // paint into it. client_rect.top += content_offset_; @@ -1287,10 +1291,11 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { } } if (ImplementPostPaint()) { - CRect cell_rect; + WTL::CRect cell_rect; if (ListView_GetItemRect(list_view_, view_index, &cell_rect, LVIR_BOUNDS)) { - PostPaint(model_index, 0, false, cell_rect, draw_info->nmcd.hdc); + PostPaint(model_index, 0, false, gfx::Rect(cell_rect), + draw_info->nmcd.hdc); r = CDRF_SKIPDEFAULT; } } @@ -1313,7 +1318,7 @@ void TableView::ResetColumnSizes() { // See comment in TableColumn for what this does. int width = this->width(); - CRect native_bounds; + WTL::CRect native_bounds; if (GetClientRect(GetNativeControlHWND(), &native_bounds) && native_bounds.Width() > 0) { // Prefer the bounds of the window over our bounds, which may be different. @@ -1524,7 +1529,7 @@ void TableView::UpdateContentOffset() { POINT origin = {0, 0}; MapWindowPoints(header, list_view_, &origin, 1); - CRect header_bounds; + WTL::CRect header_bounds; GetWindowRect(header, &header_bounds); content_offset_ = origin.y + header_bounds.Height(); diff --git a/views/controls/table/table_view.h b/views/controls/table/table_view.h index 2db5234..da228fc 100644 --- a/views/controls/table/table_view.h +++ b/views/controls/table/table_view.h @@ -9,6 +9,7 @@ #if defined(OS_WIN) #include <windows.h> +typedef struct tagNMLVCUSTOMDRAW NMLVCUSTOMDRAW; #endif // defined(OS_WIN) #include <map> @@ -470,7 +471,7 @@ class TableView : public NativeControl, virtual bool ImplementPostPaint() { return false; } // Subclasses can implement in this method extra-painting for cells. virtual void PostPaint(int model_row, int column, bool selected, - const CRect& bounds, HDC device_context) { } + const gfx::Rect& bounds, HDC device_context) { } virtual void PostPaint() {} virtual HWND CreateNativeControl(HWND parent_container); diff --git a/views/controls/text_field.cc b/views/controls/text_field.cc index 190be98..08f982a 100644 --- a/views/controls/text_field.cc +++ b/views/controls/text_field.cc @@ -8,6 +8,7 @@ #include <atlapp.h> #include <atlcrack.h> #include <atlctrls.h> +#include <atlmisc.h> #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl #include <vsstyle.h> diff --git a/views/controls/tree/tree_view.cc b/views/controls/tree/tree_view.cc index 08f2255..39e6103 100644 --- a/views/controls/tree/tree_view.cc +++ b/views/controls/tree/tree_view.cc @@ -4,7 +4,9 @@ #include "views/controls/tree/tree_view.h" -#include <shellapi.h> +#include <atlbase.h> +#include <atlapp.h> +#include <atlmisc.h> #include "app/gfx/chrome_canvas.h" #include "app/gfx/icon_util.h" @@ -30,7 +32,7 @@ TreeView::TreeView() process_enter_(false), show_context_menu_only_when_node_selected_(true), select_on_right_mouse_down_(true), - wrapper_(this), + ALLOW_THIS_IN_INITIALIZER_LIST(wrapper_(this)), original_handler_(NULL), drag_enabled_(false), has_custom_icons_(false), @@ -481,7 +483,7 @@ bool TreeView::OnKeyDown(int virtual_key_code) { return false; } -void TreeView::OnContextMenu(const CPoint& location) { +void TreeView::OnContextMenu(const WTL::CPoint& location) { if (!GetContextMenuController()) return; diff --git a/views/controls/tree/tree_view.h b/views/controls/tree/tree_view.h index 4523916..7e35097 100644 --- a/views/controls/tree/tree_view.h +++ b/views/controls/tree/tree_view.h @@ -5,6 +5,9 @@ #ifndef VIEWS_CONTROLS_TREE_TREE_VIEW_H_ #define VIEWS_CONTROLS_TREE_TREE_VIEW_H_ +#include <windows.h> +#include <commctrl.h> + #include <map> #include "app/tree_model.h" @@ -159,7 +162,7 @@ class TreeView : public NativeControl, TreeModelObserver { virtual bool NotifyOnKeyDown() const { return true; } virtual bool OnKeyDown(int virtual_key_code); - virtual void OnContextMenu(const CPoint& location); + virtual void OnContextMenu(const WTL::CPoint& location); // Returns the TreeModelNode for |tree_item|. TreeModelNode* GetNodeForTreeItem(HTREEITEM tree_item); diff --git a/views/grid_layout_unittest.cc b/views/grid_layout_unittest.cc index 57bfa83..571030c 100644 --- a/views/grid_layout_unittest.cc +++ b/views/grid_layout_unittest.cc @@ -53,7 +53,7 @@ class GridLayoutTest : public testing::Test { } gfx::Size pref; - CRect bounds; + gfx::Rect bounds; View host; GridLayout* layout; }; @@ -78,16 +78,16 @@ class GridLayoutAlignmentTest : public testing::Test { } } - void TestAlignment(GridLayout::Alignment alignment, CRect* bounds) { + void TestAlignment(GridLayout::Alignment alignment, gfx::Rect* bounds) { ColumnSet* c1 = layout->AddColumnSet(0); c1->AddColumn(alignment, alignment, 1, GridLayout::USE_PREF, 0, 0); layout->StartRow(1, 0); layout->AddView(&v1); gfx::Size pref = layout->GetPreferredSize(&host); - EXPECT_TRUE(gfx::Size(10, 20) == pref); + EXPECT_EQ(gfx::Size(10, 20), pref); host.SetBounds(0, 0, 100, 100); layout->Layout(&host); - *bounds = v1.bounds().ToRECT(); + *bounds = v1.bounds(); RemoveAll(); } @@ -97,27 +97,27 @@ class GridLayoutAlignmentTest : public testing::Test { }; TEST_F(GridLayoutAlignmentTest, Fill) { - CRect bounds; + gfx::Rect bounds; TestAlignment(GridLayout::FILL, &bounds); - EXPECT_TRUE(CRect(0, 0, 100, 100) == bounds); + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), bounds); } TEST_F(GridLayoutAlignmentTest, Leading) { - CRect bounds; + gfx::Rect bounds; TestAlignment(GridLayout::LEADING, &bounds); - EXPECT_TRUE(CRect(0, 0, 10, 20) == bounds); + EXPECT_EQ(gfx::Rect(0, 0, 10, 20), bounds); } TEST_F(GridLayoutAlignmentTest, Center) { - CRect bounds; + gfx::Rect bounds; TestAlignment(GridLayout::CENTER, &bounds); - EXPECT_TRUE(CRect(45, 40, 55, 60) == bounds); + EXPECT_EQ(gfx::Rect(45, 40, 10, 20), bounds); } TEST_F(GridLayoutAlignmentTest, Trailing) { - CRect bounds; + gfx::Rect bounds; TestAlignment(GridLayout::TRAILING, &bounds); - EXPECT_TRUE(CRect(90, 80, 100, 100) == bounds); + EXPECT_EQ(gfx::Rect(90, 80, 10, 20), bounds); } TEST_F(GridLayoutTest, TwoColumns) { @@ -133,7 +133,7 @@ TEST_F(GridLayoutTest, TwoColumns) { layout->AddView(&v2); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(30, 20) == pref); + EXPECT_EQ(gfx::Size(30, 20), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -157,7 +157,7 @@ TEST_F(GridLayoutTest, ColSpan1) { layout->AddView(&v2); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(100, 60) == pref); + EXPECT_EQ(gfx::Size(100, 60), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -182,7 +182,7 @@ TEST_F(GridLayoutTest, ColSpan2) { layout->AddView(&v2); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(100, 40) == pref); + EXPECT_EQ(gfx::Size(100, 40), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -208,7 +208,7 @@ TEST_F(GridLayoutTest, ColSpan3) { layout->AddView(&v3); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(100, 40) == pref); + EXPECT_EQ(gfx::Size(100, 40), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -238,7 +238,7 @@ TEST_F(GridLayoutTest, ColSpan4) { layout->AddView(&v3, 2, 1); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(25, 30) == pref); + EXPECT_EQ(gfx::Size(25, 30), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -263,7 +263,7 @@ TEST_F(GridLayoutTest, SameSizeColumns) { layout->AddView(&v2); gfx::Size pref = layout->GetPreferredSize(&host); - EXPECT_TRUE(gfx::Size(100, 20) == pref); + EXPECT_EQ(gfx::Size(100, 20), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -325,7 +325,7 @@ TEST_F(GridLayoutTest, TestVerticalResize1) { layout->AddView(&v2); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(50, 30) == pref); + EXPECT_EQ(gfx::Size(50, 30), pref); host.SetBounds(0, 0, 50, 100); layout->Layout(&host); @@ -345,7 +345,7 @@ TEST_F(GridLayoutTest, Insets) { layout->AddView(&v1); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(16, 24) == pref); + EXPECT_EQ(gfx::Size(16, 24), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -395,8 +395,8 @@ TEST_F(GridLayoutTest, FixedSize) { } GetPreferredSize(); - EXPECT_TRUE(gfx::Size(column_count * title_width + 4, - row_count * pref_height + 4) == pref); + EXPECT_EQ(gfx::Size(column_count * title_width + 4, + row_count * pref_height + 4), pref); } TEST_F(GridLayoutTest, RowSpanWithPaddingRow) { @@ -438,7 +438,7 @@ TEST_F(GridLayoutTest, RowSpan) { layout->AddView(s3); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(40, 40) == pref); + EXPECT_EQ(gfx::Size(40, 40), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); @@ -464,7 +464,7 @@ TEST_F(GridLayoutTest, RowSpan2) { layout->AddView(new SettableSizeView(gfx::Size(10, 20))); GetPreferredSize(); - EXPECT_TRUE(gfx::Size(84, 64) == pref); + EXPECT_EQ(gfx::Size(84, 64), pref); host.SetBounds(0, 0, pref.width(), pref.height()); layout->Layout(&host); diff --git a/views/view.h b/views/view.h index f3c5b8e..16c1f35 100644 --- a/views/view.h +++ b/views/view.h @@ -7,12 +7,6 @@ #include "build/build_config.h" -#if defined(OS_WIN) -#include <atlbase.h> -#include <atlapp.h> -#include <atlmisc.h> -#endif // defined(OS_WIN) - #include <algorithm> #include <map> #include <string> @@ -25,6 +19,10 @@ #include "views/background.h" #include "views/border.h" +#if defined(OS_WIN) +struct IDataObject; +#endif // defined(OS_WIN) + namespace gfx { class Insets; class Path; diff --git a/views/widget/root_view_drop_target.h b/views/widget/root_view_drop_target.h index a3c3afd..32cb14b 100644 --- a/views/widget/root_view_drop_target.h +++ b/views/widget/root_view_drop_target.h @@ -5,10 +5,6 @@ #ifndef VIEWS_WIDGET_ROOT_VIEW_DROP_TARGET_H_ #define VIEWS_WIDGET_ROOT_VIEW_DROP_TARGET_H_ -#include <atlbase.h> -#include <atlapp.h> -#include <atlmisc.h> - #include "app/os_exchange_data.h" #include "base/base_drop_target.h" diff --git a/views/widget/tooltip_manager.cc b/views/widget/tooltip_manager.cc index 59612e4..c082040 100644 --- a/views/widget/tooltip_manager.cc +++ b/views/widget/tooltip_manager.cc @@ -4,6 +4,7 @@ #include "views/widget/tooltip_manager.h" +#include <windowsx.h> #include <limits> #include "app/gfx/text_elider.h" diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index d948e66..b39362f 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -6,7 +6,9 @@ #define VIEWS_WIDGET_WIDGET_WIN_H_ #include <atlbase.h> +#include <atlapp.h> #include <atlcrack.h> +#include <atlmisc.h> #include "base/message_loop.h" #include "base/system_monitor.h" @@ -36,7 +38,7 @@ RootView* GetRootViewForHWND(HWND hwnd); // uMsg - kReflectedMessage // wParam - Should be 0 // lParam - Pointer to MSG struct containing the original message. -static const int kReflectedMessage = WM_APP + 3; +const int kReflectedMessage = WM_APP + 3; // These two messages aren't defined in winuser.h, but they are sent to windows // with captions. They appear to paint the window caption and frame. @@ -46,8 +48,8 @@ static const int kReflectedMessage = WM_APP + 3; // window and paint the standard caption/title over the top of the custom one. // So we need to handle these messages in CustomFrameWindow to prevent this // from happening. -static const int WM_NCUAHDRAWCAPTION = 0xAE; -static const int WM_NCUAHDRAWFRAME = 0xAF; +const int WM_NCUAHDRAWCAPTION = 0xAE; +const int WM_NCUAHDRAWFRAME = 0xAF; /////////////////////////////////////////////////////////////////////////////// // diff --git a/views/window/custom_frame_view.cc b/views/window/custom_frame_view.cc index 66e2ccd..19ce2fb 100644 --- a/views/window/custom_frame_view.cc +++ b/views/window/custom_frame_view.cc @@ -74,11 +74,12 @@ const int kCaptionTopSpacing = 1; CustomFrameView::CustomFrameView(Window* frame) : NonClientFrameView(), - close_button_(new ImageButton(this)), - restore_button_(new ImageButton(this)), - maximize_button_(new ImageButton(this)), - minimize_button_(new ImageButton(this)), - system_menu_button_(new ImageButton(this)), + ALLOW_THIS_IN_INITIALIZER_LIST(close_button_(new ImageButton(this))), + ALLOW_THIS_IN_INITIALIZER_LIST(restore_button_(new ImageButton(this))), + ALLOW_THIS_IN_INITIALIZER_LIST(maximize_button_(new ImageButton(this))), + ALLOW_THIS_IN_INITIALIZER_LIST(minimize_button_(new ImageButton(this))), + ALLOW_THIS_IN_INITIALIZER_LIST( + system_menu_button_(new ImageButton(this))), should_show_minmax_buttons_(false), frame_(frame) { InitClass(); diff --git a/views/window/window_win.h b/views/window/window_win.h index 76d5196..5a90835 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -6,8 +6,6 @@ #define VIEWS_WINDOW_WINDOW_WIN_H_ #include "views/widget/widget_win.h" -#include "views/window/client_view.h" -#include "views/window/non_client_view.h" #include "views/window/window.h" namespace gfx { |