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 "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "ui/aura/client/activation_client.h" | 9 #include "ui/aura/client/activation_client.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 DesktopNativeWidgetTopLevelHandler* top_level_handler = | 84 DesktopNativeWidgetTopLevelHandler* top_level_handler = |
85 new DesktopNativeWidgetTopLevelHandler; | 85 new DesktopNativeWidgetTopLevelHandler; |
86 | 86 |
87 child_window->SetBounds(gfx::Rect(bounds.size())); | 87 child_window->SetBounds(gfx::Rect(bounds.size())); |
88 | 88 |
89 Widget::InitParams init_params; | 89 Widget::InitParams init_params; |
90 init_params.type = full_screen ? Widget::InitParams::TYPE_WINDOW : | 90 init_params.type = full_screen ? Widget::InitParams::TYPE_WINDOW : |
91 Widget::InitParams::TYPE_POPUP; | 91 Widget::InitParams::TYPE_POPUP; |
92 init_params.bounds = bounds; | 92 init_params.bounds = bounds; |
93 init_params.ownership = Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; | 93 init_params.ownership = Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; |
94 init_params.layer_type = ui::LAYER_NOT_DRAWN; | 94 init_params.layer_type = aura::WINDOW_LAYER_NOT_DRAWN; |
95 init_params.can_activate = full_screen; | 95 init_params.can_activate = full_screen; |
96 // This widget instance will get deleted when the window is | 96 // This widget instance will get deleted when the window is |
97 // destroyed. | 97 // destroyed. |
98 top_level_handler->top_level_widget_ = new Widget(); | 98 top_level_handler->top_level_widget_ = new Widget(); |
99 top_level_handler->top_level_widget_->Init(init_params); | 99 top_level_handler->top_level_widget_->Init(init_params); |
100 | 100 |
101 top_level_handler->top_level_widget_->SetFullscreen(full_screen); | 101 top_level_handler->top_level_widget_->SetFullscreen(full_screen); |
102 top_level_handler->top_level_widget_->Show(); | 102 top_level_handler->top_level_widget_->Show(); |
103 | 103 |
104 aura::Window* native_window = | 104 aura::Window* native_window = |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // bounds and maximized windows in bad ways. | 356 // bounds and maximized windows in bad ways. |
357 if (params.type == Widget::InitParams::TYPE_WINDOW && | 357 if (params.type == Widget::InitParams::TYPE_WINDOW && |
358 !params.remove_standard_frame) { | 358 !params.remove_standard_frame) { |
359 content_window_->SetProperty(aura::client::kAnimationsDisabledKey, true); | 359 content_window_->SetProperty(aura::client::kAnimationsDisabledKey, true); |
360 } | 360 } |
361 content_window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); | 361 content_window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); |
362 content_window_->Init(params.layer_type); | 362 content_window_->Init(params.layer_type); |
363 corewm::SetShadowType(content_window_, corewm::SHADOW_TYPE_NONE); | 363 corewm::SetShadowType(content_window_, corewm::SHADOW_TYPE_NONE); |
364 | 364 |
365 content_window_container_ = new aura::Window(NULL); | 365 content_window_container_ = new aura::Window(NULL); |
366 content_window_container_->Init(ui::LAYER_NOT_DRAWN); | 366 content_window_container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
367 content_window_container_->Show(); | 367 content_window_container_->Show(); |
368 content_window_container_->AddChild(content_window_); | 368 content_window_container_->AddChild(content_window_); |
369 | 369 |
370 desktop_root_window_host_ = params.desktop_root_window_host ? | 370 desktop_root_window_host_ = params.desktop_root_window_host ? |
371 params.desktop_root_window_host : | 371 params.desktop_root_window_host : |
372 DesktopRootWindowHost::Create(native_widget_delegate_, this); | 372 DesktopRootWindowHost::Create(native_widget_delegate_, this); |
373 aura::RootWindow::CreateParams rw_params(params.bounds); | 373 aura::RootWindow::CreateParams rw_params(params.bounds); |
374 desktop_root_window_host_->Init(content_window_, params, &rw_params); | 374 desktop_root_window_host_->Init(content_window_, params, &rw_params); |
375 | 375 |
376 root_window_.reset(new aura::RootWindow(rw_params)); | 376 root_window_.reset(new aura::RootWindow(rw_params)); |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 input_method_event_filter_->SetInputMethodPropertyInRootWindow( | 1126 input_method_event_filter_->SetInputMethodPropertyInRootWindow( |
1127 root_window_->window()); | 1127 root_window_->window()); |
1128 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); | 1128 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); |
1129 } | 1129 } |
1130 | 1130 |
1131 void DesktopNativeWidgetAura::UpdateWindowTransparency() { | 1131 void DesktopNativeWidgetAura::UpdateWindowTransparency() { |
1132 content_window_->SetTransparent(ShouldUseNativeFrame()); | 1132 content_window_->SetTransparent(ShouldUseNativeFrame()); |
1133 } | 1133 } |
1134 | 1134 |
1135 } // namespace views | 1135 } // namespace views |
OLD | NEW |