| 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" |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 internal::NativeWidgetDelegate* delegate) OVERRIDE { | 1106 internal::NativeWidgetDelegate* delegate) OVERRIDE { |
| 1107 if (!params->native_widget) | 1107 if (!params->native_widget) |
| 1108 params->native_widget = new views::DesktopNativeWidgetAura(delegate); | 1108 params->native_widget = new views::DesktopNativeWidgetAura(delegate); |
| 1109 } | 1109 } |
| 1110 | 1110 |
| 1111 void CreateTopLevelWindow(const gfx::Rect& bounds, bool fullscreen) { | 1111 void CreateTopLevelWindow(const gfx::Rect& bounds, bool fullscreen) { |
| 1112 Widget::InitParams init_params; | 1112 Widget::InitParams init_params; |
| 1113 init_params.type = Widget::InitParams::TYPE_WINDOW; | 1113 init_params.type = Widget::InitParams::TYPE_WINDOW; |
| 1114 init_params.bounds = bounds; | 1114 init_params.bounds = bounds; |
| 1115 init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 1115 init_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 1116 init_params.layer_type = ui::LAYER_NOT_DRAWN; | 1116 init_params.layer_type = aura::WINDOW_LAYER_NOT_DRAWN; |
| 1117 init_params.accept_events = fullscreen; | 1117 init_params.accept_events = fullscreen; |
| 1118 | 1118 |
| 1119 widget_.Init(init_params); | 1119 widget_.Init(init_params); |
| 1120 | 1120 |
| 1121 owned_window_ = new aura::Window(&child_window_delegate_); | 1121 owned_window_ = new aura::Window(&child_window_delegate_); |
| 1122 owned_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 1122 owned_window_->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 1123 owned_window_->SetName("TestTopLevelWindow"); | 1123 owned_window_->SetName("TestTopLevelWindow"); |
| 1124 if (fullscreen) { | 1124 if (fullscreen) { |
| 1125 owned_window_->SetProperty(aura::client::kShowStateKey, | 1125 owned_window_->SetProperty(aura::client::kShowStateKey, |
| 1126 ui::SHOW_STATE_FULLSCREEN); | 1126 ui::SHOW_STATE_FULLSCREEN); |
| 1127 } else { | 1127 } else { |
| 1128 owned_window_->SetType(ui::wm::WINDOW_TYPE_MENU); | 1128 owned_window_->SetType(ui::wm::WINDOW_TYPE_MENU); |
| 1129 } | 1129 } |
| 1130 owned_window_->Init(ui::LAYER_TEXTURED); | 1130 owned_window_->Init(aura::WINDOW_LAYER_TEXTURED); |
| 1131 aura::client::ParentWindowWithContext( | 1131 aura::client::ParentWindowWithContext( |
| 1132 owned_window_, | 1132 owned_window_, |
| 1133 widget_.GetNativeView()->GetRootWindow(), | 1133 widget_.GetNativeView()->GetRootWindow(), |
| 1134 gfx::Rect(0, 0, 1900, 1600)); | 1134 gfx::Rect(0, 0, 1900, 1600)); |
| 1135 owned_window_->Show(); | 1135 owned_window_->Show(); |
| 1136 owned_window_->AddObserver(this); | 1136 owned_window_->AddObserver(this); |
| 1137 | 1137 |
| 1138 ASSERT_TRUE(owned_window_->parent() != NULL); | 1138 ASSERT_TRUE(owned_window_->parent() != NULL); |
| 1139 owned_window_->parent()->AddObserver(this); | 1139 owned_window_->parent()->AddObserver(this); |
| 1140 | 1140 |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2254 EXPECT_EQ(activate_result, MA_ACTIVATE); | 2254 EXPECT_EQ(activate_result, MA_ACTIVATE); |
| 2255 | 2255 |
| 2256 modal_dialog_widget->CloseNow(); | 2256 modal_dialog_widget->CloseNow(); |
| 2257 top_level_widget.CloseNow(); | 2257 top_level_widget.CloseNow(); |
| 2258 } | 2258 } |
| 2259 #endif | 2259 #endif |
| 2260 #endif | 2260 #endif |
| 2261 | 2261 |
| 2262 } // namespace test | 2262 } // namespace test |
| 2263 } // namespace views | 2263 } // namespace views |
| OLD | NEW |