| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bubble/bubble_dialog_delegate.h" | 5 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 TestBubbleDialogDelegateView(View* anchor_view) | 26 TestBubbleDialogDelegateView(View* anchor_view) |
| 27 : BubbleDialogDelegateView(anchor_view, BubbleBorder::TOP_LEFT), | 27 : BubbleDialogDelegateView(anchor_view, BubbleBorder::TOP_LEFT), |
| 28 view_(new View()) { | 28 view_(new View()) { |
| 29 view_->SetFocusBehavior(FocusBehavior::ALWAYS); | 29 view_->SetFocusBehavior(FocusBehavior::ALWAYS); |
| 30 AddChildView(view_); | 30 AddChildView(view_); |
| 31 } | 31 } |
| 32 ~TestBubbleDialogDelegateView() override {} | 32 ~TestBubbleDialogDelegateView() override {} |
| 33 | 33 |
| 34 // BubbleDialogDelegateView overrides: | 34 // BubbleDialogDelegateView overrides: |
| 35 View* GetInitiallyFocusedView() override { return view_; } | 35 View* GetInitiallyFocusedView() override { return view_; } |
| 36 gfx::Size GetPreferredSize() const override { return gfx::Size(200, 200); } | 36 gfx::Size GetUnsnappedPreferredSize() const override { |
| 37 return gfx::Size(200, 200); |
| 38 } |
| 37 | 39 |
| 38 using BubbleDialogDelegateView::SetAnchorRect; | 40 using BubbleDialogDelegateView::SetAnchorRect; |
| 39 using BubbleDialogDelegateView::GetBubbleFrameView; | 41 using BubbleDialogDelegateView::GetBubbleFrameView; |
| 40 | 42 |
| 41 private: | 43 private: |
| 42 View* view_; | 44 View* view_; |
| 43 | 45 |
| 44 DISALLOW_COPY_AND_ASSIGN(TestBubbleDialogDelegateView); | 46 DISALLOW_COPY_AND_ASSIGN(TestBubbleDialogDelegateView); |
| 45 }; | 47 }; |
| 46 | 48 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 ASSERT_TRUE(close_button); | 327 ASSERT_TRUE(close_button); |
| 326 frame_view->ButtonPressed( | 328 frame_view->ButtonPressed( |
| 327 close_button, | 329 close_button, |
| 328 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 330 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), |
| 329 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE)); | 331 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE)); |
| 330 EXPECT_TRUE(bubble_widget->IsClosed()); | 332 EXPECT_TRUE(bubble_widget->IsClosed()); |
| 331 } | 333 } |
| 332 } | 334 } |
| 333 | 335 |
| 334 } // namespace views | 336 } // namespace views |
| OLD | NEW |