| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/events/event_utils.h" | 15 #include "ui/events/event_utils.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 #include "ui/gfx/point.h" | 17 #include "ui/gfx/point.h" |
| 18 #include "ui/views/bubble/bubble_delegate.h" | 18 #include "ui/views/bubble/bubble_delegate.h" |
| 19 #include "ui/views/controls/textfield/textfield.h" | 19 #include "ui/views/controls/textfield/textfield.h" |
| 20 #include "ui/views/test/test_views_delegate.h" | 20 #include "ui/views/test/test_views_delegate.h" |
| 21 #include "ui/views/test/widget_test.h" | 21 #include "ui/views/test/widget_test.h" |
| 22 #include "ui/views/views_delegate.h" | 22 #include "ui/views/views_delegate.h" |
| 23 #include "ui/views/widget/native_widget_delegate.h" | 23 #include "ui/views/widget/native_widget_delegate.h" |
| 24 #include "ui/views/widget/root_view.h" | 24 #include "ui/views/widget/root_view.h" |
| 25 #include "ui/views/window/dialog_delegate.h" | 25 #include "ui/views/window/dialog_delegate.h" |
| 26 #include "ui/views/window/native_frame_view.h" | 26 #include "ui/views/window/native_frame_view.h" |
| 27 | 27 |
| 28 #if defined(USE_AURA) | 28 #if defined(USE_AURA) |
| 29 #include "ui/aura/client/aura_constants.h" | 29 #include "ui/aura/client/aura_constants.h" |
| 30 #include "ui/aura/client/window_tree_client.h" |
| 30 #include "ui/aura/root_window.h" | 31 #include "ui/aura/root_window.h" |
| 31 #include "ui/aura/test/test_window_delegate.h" | 32 #include "ui/aura/test/test_window_delegate.h" |
| 32 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 33 #include "ui/views/widget/native_widget_aura.h" | 34 #include "ui/views/widget/native_widget_aura.h" |
| 34 #if !defined(OS_CHROMEOS) | 35 #if !defined(OS_CHROMEOS) |
| 35 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 36 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 36 #endif | 37 #endif |
| 37 #elif defined(OS_WIN) | 38 #elif defined(OS_WIN) |
| 38 #include "ui/views/widget/native_widget_win.h" | 39 #include "ui/views/widget/native_widget_win.h" |
| 39 #endif | 40 #endif |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 owned_window_ = new aura::Window(&child_window_delegate_); | 1136 owned_window_ = new aura::Window(&child_window_delegate_); |
| 1136 owned_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); | 1137 owned_window_->SetType(aura::client::WINDOW_TYPE_NORMAL); |
| 1137 owned_window_->SetName("TestTopLevelWindow"); | 1138 owned_window_->SetName("TestTopLevelWindow"); |
| 1138 if (fullscreen) { | 1139 if (fullscreen) { |
| 1139 owned_window_->SetProperty(aura::client::kShowStateKey, | 1140 owned_window_->SetProperty(aura::client::kShowStateKey, |
| 1140 ui::SHOW_STATE_FULLSCREEN); | 1141 ui::SHOW_STATE_FULLSCREEN); |
| 1141 } else { | 1142 } else { |
| 1142 owned_window_->SetType(aura::client::WINDOW_TYPE_MENU); | 1143 owned_window_->SetType(aura::client::WINDOW_TYPE_MENU); |
| 1143 } | 1144 } |
| 1144 owned_window_->Init(ui::LAYER_TEXTURED); | 1145 owned_window_->Init(ui::LAYER_TEXTURED); |
| 1145 owned_window_->SetDefaultParentByRootWindow( | 1146 aura::client::ParentWindowWithContext( |
| 1146 widget_.GetNativeView()->GetRootWindow(), gfx::Rect(0, 0, 1900, 1600)); | 1147 owned_window_, |
| 1148 widget_.GetNativeView()->GetRootWindow(), |
| 1149 gfx::Rect(0, 0, 1900, 1600)); |
| 1147 owned_window_->Show(); | 1150 owned_window_->Show(); |
| 1148 owned_window_->AddObserver(this); | 1151 owned_window_->AddObserver(this); |
| 1149 | 1152 |
| 1150 ASSERT_TRUE(owned_window_->parent() != NULL); | 1153 ASSERT_TRUE(owned_window_->parent() != NULL); |
| 1151 owned_window_->parent()->AddObserver(this); | 1154 owned_window_->parent()->AddObserver(this); |
| 1152 | 1155 |
| 1153 top_level_widget_ = | 1156 top_level_widget_ = |
| 1154 views::Widget::GetWidgetForNativeView(owned_window_->parent()); | 1157 views::Widget::GetWidgetForNativeView(owned_window_->parent()); |
| 1155 ASSERT_TRUE(top_level_widget_ != NULL); | 1158 ASSERT_TRUE(top_level_widget_ != NULL); |
| 1156 } | 1159 } |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 EXPECT_EQ(activate_result, MA_ACTIVATE); | 2151 EXPECT_EQ(activate_result, MA_ACTIVATE); |
| 2149 | 2152 |
| 2150 modal_dialog_widget->CloseNow(); | 2153 modal_dialog_widget->CloseNow(); |
| 2151 top_level_widget.CloseNow(); | 2154 top_level_widget.CloseNow(); |
| 2152 } | 2155 } |
| 2153 #endif | 2156 #endif |
| 2154 #endif | 2157 #endif |
| 2155 | 2158 |
| 2156 } // namespace test | 2159 } // namespace test |
| 2157 } // namespace views | 2160 } // namespace views |
| OLD | NEW |