OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 TEST_F(NativeWidgetAuraTest, GetClientAreaScreenBounds) { | 166 TEST_F(NativeWidgetAuraTest, GetClientAreaScreenBounds) { |
167 // Create a widget. | 167 // Create a widget. |
168 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); | 168 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); |
169 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 169 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
170 params.bounds.SetRect(10, 20, 300, 400); | 170 params.bounds.SetRect(10, 20, 300, 400); |
171 scoped_ptr<Widget> widget(new Widget()); | 171 scoped_ptr<Widget> widget(new Widget()); |
172 widget->Init(params); | 172 widget->Init(params); |
173 | 173 |
174 // For Aura, client area bounds match window bounds. | 174 // For Aura, client area bounds match window bounds. |
175 gfx::Rect client_bounds = widget->GetClientAreaScreenBounds(); | 175 gfx::Rect client_bounds = widget->GetClientAreaBoundsInScreen(); |
176 EXPECT_EQ(10, client_bounds.x()); | 176 EXPECT_EQ(10, client_bounds.x()); |
177 EXPECT_EQ(20, client_bounds.y()); | 177 EXPECT_EQ(20, client_bounds.y()); |
178 EXPECT_EQ(300, client_bounds.width()); | 178 EXPECT_EQ(300, client_bounds.width()); |
179 EXPECT_EQ(400, client_bounds.height()); | 179 EXPECT_EQ(400, client_bounds.height()); |
180 } | 180 } |
181 | 181 |
182 namespace { | 182 namespace { |
183 | 183 |
184 // View subclass that tracks whether it has gotten a gesture event. | 184 // View subclass that tracks whether it has gotten a gesture event. |
185 class GestureTrackingView : public views::View { | 185 class GestureTrackingView : public views::View { |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 parent->GetNativeWindow()->GetEventHandlerForPoint( | 350 parent->GetNativeWindow()->GetEventHandlerForPoint( |
351 gfx::Point(20, 20))); | 351 gfx::Point(20, 20))); |
352 | 352 |
353 // Work around for bug in NativeWidgetAura. | 353 // Work around for bug in NativeWidgetAura. |
354 // TODO: fix bug and remove this. | 354 // TODO: fix bug and remove this. |
355 parent->Close(); | 355 parent->Close(); |
356 } | 356 } |
357 | 357 |
358 } // namespace | 358 } // namespace |
359 } // namespace views | 359 } // namespace views |
OLD | NEW |