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/base/hit_test.h" | 5 #include "ui/base/hit_test.h" |
6 #include "ui/views/bubble/bubble_delegate.h" | 6 #include "ui/views/bubble/bubble_delegate.h" |
7 #include "ui/views/bubble/bubble_frame_view.h" | 7 #include "ui/views/bubble/bubble_frame_view.h" |
8 #include "ui/views/test/test_widget_observer.h" | 8 #include "ui/views/test/test_widget_observer.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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void SetAnchorRectForTest(gfx::Rect rect) { | 27 void SetAnchorRectForTest(gfx::Rect rect) { |
28 SetAnchorRect(rect); | 28 SetAnchorRect(rect); |
29 } | 29 } |
30 | 30 |
31 void SetAnchorViewForTest(View* view) { | 31 void SetAnchorViewForTest(View* view) { |
32 SetAnchorView(view); | 32 SetAnchorView(view); |
33 } | 33 } |
34 | 34 |
35 // BubbleDelegateView overrides: | 35 // BubbleDelegateView overrides: |
36 virtual View* GetInitiallyFocusedView() OVERRIDE { return view_; } | 36 virtual View* GetInitiallyFocusedView() override { return view_; } |
37 virtual gfx::Size GetPreferredSize() const OVERRIDE { | 37 virtual gfx::Size GetPreferredSize() const override { |
38 return gfx::Size(200, 200); | 38 return gfx::Size(200, 200); |
39 } | 39 } |
40 | 40 |
41 private: | 41 private: |
42 View* view_; | 42 View* view_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(TestBubbleDelegateView); | 44 DISALLOW_COPY_AND_ASSIGN(TestBubbleDelegateView); |
45 }; | 45 }; |
46 | 46 |
47 class BubbleDelegateTest : public ViewsTestBase { | 47 class BubbleDelegateTest : public ViewsTestBase { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 scoped_ptr<Widget> anchor_widget(CreateTestWidget()); | 256 scoped_ptr<Widget> anchor_widget(CreateTestWidget()); |
257 BubbleDelegateView* bubble_delegate = new BubbleDelegateView( | 257 BubbleDelegateView* bubble_delegate = new BubbleDelegateView( |
258 anchor_widget->GetContentsView(), BubbleBorder::NONE); | 258 anchor_widget->GetContentsView(), BubbleBorder::NONE); |
259 bubble_delegate->set_can_activate(false); | 259 bubble_delegate->set_can_activate(false); |
260 Widget* bubble_widget = BubbleDelegateView::CreateBubble(bubble_delegate); | 260 Widget* bubble_widget = BubbleDelegateView::CreateBubble(bubble_delegate); |
261 bubble_widget->Show(); | 261 bubble_widget->Show(); |
262 EXPECT_FALSE(bubble_widget->CanActivate()); | 262 EXPECT_FALSE(bubble_widget->CanActivate()); |
263 } | 263 } |
264 | 264 |
265 } // namespace views | 265 } // namespace views |
OLD | NEW |