OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/test/base/scoped_testing_local_state.h" | 5 #include "chrome/test/base/scoped_testing_local_state.h" |
6 #include "chrome/test/base/testing_browser_process.h" | 6 #include "chrome/test/base/testing_browser_process.h" |
7 #include "chrome/test/base/view_event_test_base.h" | 7 #include "chrome/test/base/view_event_test_base.h" |
8 #include "ui/views/controls/native/native_view_host.h" | 8 #include "ui/views/controls/native/native_view_host.h" |
9 #include "ui/views/widget/widget.h" | 9 #include "ui/views/widget/widget.h" |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 private: | 79 private: |
80 void AttachChildWidget() { | 80 void AttachChildWidget() { |
81 child_ = new views::Widget(); | 81 child_ = new views::Widget(); |
82 views::Widget::InitParams child_params( | 82 views::Widget::InitParams child_params( |
83 views::Widget::InitParams::TYPE_CONTROL); | 83 views::Widget::InitParams::TYPE_CONTROL); |
84 child_params.parent = window_->GetNativeView(); | 84 child_params.parent = window_->GetNativeView(); |
85 child_->Init(child_params); | 85 child_->Init(child_params); |
86 | 86 |
87 native_view_host_ = new views::NativeViewHost; | 87 native_view_host_ = new views::NativeViewHost; |
88 native_view_host_->set_focusable(true); | 88 native_view_host_->SetFocusable(true); |
89 contents_view_->AddChildView(native_view_host_); | 89 contents_view_->AddChildView(native_view_host_); |
90 native_view_host_->SetBoundsRect(gfx::Rect(0, 0, 200, 200)); | 90 native_view_host_->SetBoundsRect(gfx::Rect(0, 0, 200, 200)); |
91 native_view_host_->Attach(child_->GetNativeView()); | 91 native_view_host_->Attach(child_->GetNativeView()); |
92 } | 92 } |
93 | 93 |
94 // Owned by the parent widget. | 94 // Owned by the parent widget. |
95 views::Widget* child_; | 95 views::Widget* child_; |
96 | 96 |
97 // Owned by the parent View. | 97 // Owned by the parent View. |
98 views::NativeViewHost* native_view_host_; | 98 views::NativeViewHost* native_view_host_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest1); | 100 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWinTest1); |
101 }; | 101 }; |
102 | 102 |
103 VIEW_TEST(NativeWidgetWinTest1, FocusRestoredToChildAfterMiniminize) | 103 VIEW_TEST(NativeWidgetWinTest1, FocusRestoredToChildAfterMiniminize) |
OLD | NEW |