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

Side by Side Diff: views/widget/native_widget_aura.cc

Issue 8387043: [Aura] Support always-on-top top level window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and update comment per ben Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/widget/native_widget_aura.h" 5 #include "views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/desktop.h" 9 #include "ui/aura/desktop.h"
10 #include "ui/aura/desktop_observer.h" 10 #include "ui/aura/desktop_observer.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 window_->set_minimum_size(delegate_->GetMinimumSize()); 136 window_->set_minimum_size(delegate_->GetMinimumSize());
137 window_->SetBounds(params.bounds); 137 window_->SetBounds(params.bounds);
138 if (window_type == Widget::InitParams::TYPE_CONTROL) { 138 if (window_type == Widget::InitParams::TYPE_CONTROL) {
139 window_->SetParent(params.GetParent()); 139 window_->SetParent(params.GetParent());
140 } else { 140 } else {
141 // Set up the transient child before the window is added. This way the 141 // Set up the transient child before the window is added. This way the
142 // LayoutManager knows the window has a transient parent. 142 // LayoutManager knows the window has a transient parent.
143 gfx::NativeView parent = params.GetParent(); 143 gfx::NativeView parent = params.GetParent();
144 if (parent) 144 if (parent)
145 parent->AddTransientChild(window_); 145 parent->AddTransientChild(window_);
146 // SetAlwaysOnTop before SetParent so that always-on-top container is used.
147 SetAlwaysOnTop(params.keep_on_top);
146 window_->SetParent(NULL); 148 window_->SetParent(NULL);
147 } 149 }
148 // TODO(beng): do this some other way. 150 // TODO(beng): do this some other way.
149 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); 151 delegate_->OnNativeWidgetSizeChanged(params.bounds.size());
150 can_activate_ = params.can_activate; 152 can_activate_ = params.can_activate;
151 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { 153 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) {
152 DCHECK(GetWidget()->GetRootView()); 154 DCHECK(GetWidget()->GetRootView());
153 views::TooltipManagerViews* manager = new views::TooltipManagerViews( 155 views::TooltipManagerViews* manager = new views::TooltipManagerViews(
154 GetWidget()->GetRootView()); 156 GetWidget()->GetRootView());
155 tooltip_manager_.reset(manager); 157 tooltip_manager_.reset(manager);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 405
404 void NativeWidgetAura::Deactivate() { 406 void NativeWidgetAura::Deactivate() {
405 window_->Deactivate(); 407 window_->Deactivate();
406 } 408 }
407 409
408 bool NativeWidgetAura::IsActive() const { 410 bool NativeWidgetAura::IsActive() const {
409 return aura::Desktop::GetInstance()->active_window() == window_; 411 return aura::Desktop::GetInstance()->active_window() == window_;
410 } 412 }
411 413
412 void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { 414 void NativeWidgetAura::SetAlwaysOnTop(bool on_top) {
413 // http://crbug.com/102582 415 window_->SetIntProperty(aura::kAlwaysOnTopKey, on_top);
414 NOTIMPLEMENTED();
415 } 416 }
416 417
417 void NativeWidgetAura::Maximize() { 418 void NativeWidgetAura::Maximize() {
418 window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); 419 window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_MAXIMIZED);
419 } 420 }
420 421
421 void NativeWidgetAura::Minimize() { 422 void NativeWidgetAura::Minimize() {
422 NOTREACHED(); 423 NOTREACHED();
423 } 424 }
424 425
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 NOTIMPLEMENTED(); 722 NOTIMPLEMENTED();
722 } 723 }
723 724
724 // static 725 // static
725 bool NativeWidgetPrivate::IsMouseButtonDown() { 726 bool NativeWidgetPrivate::IsMouseButtonDown() {
726 return aura::Desktop::GetInstance()->IsMouseButtonDown(); 727 return aura::Desktop::GetInstance()->IsMouseButtonDown();
727 } 728 }
728 729
729 } // namespace internal 730 } // namespace internal
730 } // namespace views 731 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698