| OLD | NEW |
| 1 // Copyright (c) 2011 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/base/hit_test.h" | 5 #include "ui/base/hit_test.h" |
| 6 #include "ui/views/bubble/bubble_border.h" | 6 #include "ui/views/bubble/bubble_border.h" |
| 7 #include "ui/views/bubble/bubble_delegate.h" | 7 #include "ui/views/bubble/bubble_delegate.h" |
| 8 #include "ui/views/bubble/bubble_frame_view.h" | 8 #include "ui/views/bubble/bubble_frame_view.h" |
| 9 #include "ui/views/test/views_test_base.h" | 9 #include "ui/views/test/views_test_base.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| 11 | 11 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 SizedBubbleDelegateView::SizedBubbleDelegateView() {} | 35 SizedBubbleDelegateView::SizedBubbleDelegateView() {} |
| 36 | 36 |
| 37 SizedBubbleDelegateView::~SizedBubbleDelegateView() {} | 37 SizedBubbleDelegateView::~SizedBubbleDelegateView() {} |
| 38 | 38 |
| 39 gfx::Size SizedBubbleDelegateView::GetPreferredSize() { return kRect.size(); } | 39 gfx::Size SizedBubbleDelegateView::GetPreferredSize() { return kRect.size(); } |
| 40 | 40 |
| 41 class TestBubbleFrameView : public BubbleFrameView { | 41 class TestBubbleFrameView : public BubbleFrameView { |
| 42 public: | 42 public: |
| 43 TestBubbleFrameView(const gfx::Rect& bounds); | 43 explicit TestBubbleFrameView(const gfx::Rect& bounds); |
| 44 virtual ~TestBubbleFrameView(); | 44 virtual ~TestBubbleFrameView(); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 virtual gfx::Rect GetMonitorBounds(const gfx::Rect& rect) OVERRIDE; | 47 virtual gfx::Rect GetMonitorBounds(const gfx::Rect& rect) OVERRIDE; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 gfx::Rect monitor_bounds_; | 50 gfx::Rect monitor_bounds_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(TestBubbleFrameView); | 52 DISALLOW_COPY_AND_ASSIGN(TestBubbleFrameView); |
| 53 }; | 53 }; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 gfx::Size(500, 500), // |client_size| | 224 gfx::Size(500, 500), // |client_size| |
| 225 false); // |try_mirroring_arrow| | 225 false); // |try_mirroring_arrow| |
| 226 EXPECT_EQ(BubbleBorder::TOP_RIGHT, frame.bubble_border()->arrow_location()); | 226 EXPECT_EQ(BubbleBorder::TOP_RIGHT, frame.bubble_border()->arrow_location()); |
| 227 // The coordinates should be pointing to anchor_rect from TOP_RIGHT. | 227 // The coordinates should be pointing to anchor_rect from TOP_RIGHT. |
| 228 EXPECT_LT(window_bounds.x(), 100 + 50 - 500); | 228 EXPECT_LT(window_bounds.x(), 100 + 50 - 500); |
| 229 EXPECT_GT(window_bounds.y(), 900 + 50 - 10); // -10 to roughly compensate for | 229 EXPECT_GT(window_bounds.y(), 900 + 50 - 10); // -10 to roughly compensate for |
| 230 // arrow overlap. | 230 // arrow overlap. |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace views | 233 } // namespace views |
| OLD | NEW |