Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: ui/views/bubble/bubble_dialog_delegate_unittest.cc

Issue 1898633004: Views: Add new SetFocusBehavior method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/message_center/views/padded_button.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/macros.h" 9 #include "base/macros.h"
10 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
11 #include "ui/events/event_utils.h" 11 #include "ui/events/event_utils.h"
12 #include "ui/views/bubble/bubble_frame_view.h" 12 #include "ui/views/bubble/bubble_frame_view.h"
13 #include "ui/views/controls/button/label_button.h" 13 #include "ui/views/controls/button/label_button.h"
14 #include "ui/views/test/test_widget_observer.h" 14 #include "ui/views/test/test_widget_observer.h"
15 #include "ui/views/test/views_test_base.h" 15 #include "ui/views/test/views_test_base.h"
16 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
17 #include "ui/views/widget/widget_observer.h" 17 #include "ui/views/widget/widget_observer.h"
18 18
19 namespace views { 19 namespace views {
20 20
21 namespace { 21 namespace {
22 22
23 class TestBubbleDialogDelegateView : public BubbleDialogDelegateView { 23 class TestBubbleDialogDelegateView : public BubbleDialogDelegateView {
24 public: 24 public:
25 TestBubbleDialogDelegateView(View* anchor_view) 25 TestBubbleDialogDelegateView(View* anchor_view)
26 : BubbleDialogDelegateView(anchor_view, BubbleBorder::TOP_LEFT), 26 : BubbleDialogDelegateView(anchor_view, BubbleBorder::TOP_LEFT),
27 view_(new View()) { 27 view_(new View()) {
28 view_->SetFocusable(true); 28 view_->SetFocusBehavior(FocusBehavior::ALWAYS);
29 AddChildView(view_); 29 AddChildView(view_);
30 } 30 }
31 ~TestBubbleDialogDelegateView() override {} 31 ~TestBubbleDialogDelegateView() override {}
32 32
33 // BubbleDialogDelegateView overrides: 33 // BubbleDialogDelegateView overrides:
34 View* GetInitiallyFocusedView() override { return view_; } 34 View* GetInitiallyFocusedView() override { return view_; }
35 gfx::Size GetPreferredSize() const override { return gfx::Size(200, 200); } 35 gfx::Size GetPreferredSize() const override { return gfx::Size(200, 200); }
36 36
37 using BubbleDialogDelegateView::SetAnchorRect; 37 using BubbleDialogDelegateView::SetAnchorRect;
38 using BubbleDialogDelegateView::GetBubbleFrameView; 38 using BubbleDialogDelegateView::GetBubbleFrameView;
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 ASSERT_TRUE(close_button); 306 ASSERT_TRUE(close_button);
307 frame_view->ButtonPressed( 307 frame_view->ButtonPressed(
308 close_button, 308 close_button,
309 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), 309 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
310 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE)); 310 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE));
311 EXPECT_TRUE(bubble_widget->IsClosed()); 311 EXPECT_TRUE(bubble_widget->IsClosed());
312 } 312 }
313 } 313 }
314 314
315 } // namespace views 315 } // namespace views
OLDNEW
« no previous file with comments | « ui/message_center/views/padded_button.cc ('k') | ui/views/color_chooser/color_chooser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698