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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 1050713002: aura: Remove layerless windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layerless: rebase Created 5 years, 8 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
OLDNEW
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/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 DesktopNativeWidgetTopLevelHandler* top_level_handler = 89 DesktopNativeWidgetTopLevelHandler* top_level_handler =
90 new DesktopNativeWidgetTopLevelHandler; 90 new DesktopNativeWidgetTopLevelHandler;
91 91
92 child_window->SetBounds(gfx::Rect(bounds.size())); 92 child_window->SetBounds(gfx::Rect(bounds.size()));
93 93
94 Widget::InitParams init_params; 94 Widget::InitParams init_params;
95 init_params.type = full_screen ? Widget::InitParams::TYPE_WINDOW : 95 init_params.type = full_screen ? Widget::InitParams::TYPE_WINDOW :
96 Widget::InitParams::TYPE_POPUP; 96 Widget::InitParams::TYPE_POPUP;
97 init_params.bounds = bounds; 97 init_params.bounds = bounds;
98 init_params.ownership = Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; 98 init_params.ownership = Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET;
99 init_params.layer_type = aura::WINDOW_LAYER_NOT_DRAWN; 99 init_params.layer_type = ui::LAYER_NOT_DRAWN;
100 init_params.activatable = full_screen ? 100 init_params.activatable = full_screen ?
101 Widget::InitParams::ACTIVATABLE_YES : 101 Widget::InitParams::ACTIVATABLE_YES :
102 Widget::InitParams::ACTIVATABLE_NO; 102 Widget::InitParams::ACTIVATABLE_NO;
103 init_params.keep_on_top = root_is_always_on_top; 103 init_params.keep_on_top = root_is_always_on_top;
104 104
105 // This widget instance will get deleted when the window is 105 // This widget instance will get deleted when the window is
106 // destroyed. 106 // destroyed.
107 top_level_handler->top_level_widget_ = new Widget(); 107 top_level_handler->top_level_widget_ = new Widget();
108 top_level_handler->top_level_widget_->Init(init_params); 108 top_level_handler->top_level_widget_->Init(init_params);
109 109
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // bounds and maximized windows in bad ways. 406 // bounds and maximized windows in bad ways.
407 if (params.type == Widget::InitParams::TYPE_WINDOW && 407 if (params.type == Widget::InitParams::TYPE_WINDOW &&
408 !params.remove_standard_frame) { 408 !params.remove_standard_frame) {
409 content_window_->SetProperty(aura::client::kAnimationsDisabledKey, true); 409 content_window_->SetProperty(aura::client::kAnimationsDisabledKey, true);
410 } 410 }
411 content_window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); 411 content_window_->SetType(GetAuraWindowTypeForWidgetType(params.type));
412 content_window_->Init(params.layer_type); 412 content_window_->Init(params.layer_type);
413 wm::SetShadowType(content_window_, wm::SHADOW_TYPE_NONE); 413 wm::SetShadowType(content_window_, wm::SHADOW_TYPE_NONE);
414 414
415 content_window_container_ = new aura::Window(NULL); 415 content_window_container_ = new aura::Window(NULL);
416 content_window_container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); 416 content_window_container_->Init(ui::LAYER_NOT_DRAWN);
417 content_window_container_->Show(); 417 content_window_container_->Show();
418 content_window_container_->AddChild(content_window_); 418 content_window_container_->AddChild(content_window_);
419 419
420 desktop_window_tree_host_ = params.desktop_window_tree_host ? 420 desktop_window_tree_host_ = params.desktop_window_tree_host ?
421 params.desktop_window_tree_host : 421 params.desktop_window_tree_host :
422 DesktopWindowTreeHost::Create(native_widget_delegate_, this); 422 DesktopWindowTreeHost::Create(native_widget_delegate_, this);
423 host_.reset(desktop_window_tree_host_->AsWindowTreeHost()); 423 host_.reset(desktop_window_tree_host_->AsWindowTreeHost());
424 desktop_window_tree_host_->Init(content_window_, params); 424 desktop_window_tree_host_->Init(content_window_, params);
425 425
426 host_->InitHost(); 426 host_->InitHost();
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 if (cursor_reference_count_ == 0) { 1239 if (cursor_reference_count_ == 0) {
1240 // We are the last DesktopNativeWidgetAura instance, and we are responsible 1240 // We are the last DesktopNativeWidgetAura instance, and we are responsible
1241 // for cleaning up |cursor_manager_|. 1241 // for cleaning up |cursor_manager_|.
1242 delete cursor_manager_; 1242 delete cursor_manager_;
1243 native_cursor_manager_ = NULL; 1243 native_cursor_manager_ = NULL;
1244 cursor_manager_ = NULL; 1244 cursor_manager_ = NULL;
1245 } 1245 }
1246 } 1246 }
1247 1247
1248 } // namespace views 1248 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698