| OLD | NEW |
| 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/aura_constants.h" | 8 #include "ui/aura/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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 window_->set_minimum_size(delegate_->GetMinimumSize()); | 137 window_->set_minimum_size(delegate_->GetMinimumSize()); |
| 138 window_->SetBounds(params.bounds); | 138 window_->SetBounds(params.bounds); |
| 139 if (params.type == Widget::InitParams::TYPE_CONTROL) { | 139 if (params.type == Widget::InitParams::TYPE_CONTROL) { |
| 140 window_->SetParent(params.GetParent()); | 140 window_->SetParent(params.GetParent()); |
| 141 } else { | 141 } else { |
| 142 // Set up the transient child before the window is added. This way the | 142 // Set up the transient child before the window is added. This way the |
| 143 // LayoutManager knows the window has a transient parent. | 143 // LayoutManager knows the window has a transient parent. |
| 144 gfx::NativeView parent = params.GetParent(); | 144 gfx::NativeView parent = params.GetParent(); |
| 145 if (parent) | 145 if (parent) |
| 146 parent->AddTransientChild(window_); | 146 parent->AddTransientChild(window_); |
| 147 // SetAlwaysOnTop before SetParent so that always-on-top container is used. |
| 148 SetAlwaysOnTop(params.keep_on_top); |
| 147 window_->SetParent(NULL); | 149 window_->SetParent(NULL); |
| 148 } | 150 } |
| 149 // TODO(beng): do this some other way. | 151 // TODO(beng): do this some other way. |
| 150 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); | 152 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); |
| 151 can_activate_ = params.can_activate; | 153 can_activate_ = params.can_activate; |
| 152 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { | 154 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { |
| 153 DCHECK(GetWidget()->GetRootView()); | 155 DCHECK(GetWidget()->GetRootView()); |
| 154 views::TooltipManagerViews* manager = new views::TooltipManagerViews( | 156 views::TooltipManagerViews* manager = new views::TooltipManagerViews( |
| 155 GetWidget()->GetRootView()); | 157 GetWidget()->GetRootView()); |
| 156 tooltip_manager_.reset(manager); | 158 tooltip_manager_.reset(manager); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 413 |
| 412 void NativeWidgetAura::Deactivate() { | 414 void NativeWidgetAura::Deactivate() { |
| 413 window_->Deactivate(); | 415 window_->Deactivate(); |
| 414 } | 416 } |
| 415 | 417 |
| 416 bool NativeWidgetAura::IsActive() const { | 418 bool NativeWidgetAura::IsActive() const { |
| 417 return aura::Desktop::GetInstance()->active_window() == window_; | 419 return aura::Desktop::GetInstance()->active_window() == window_; |
| 418 } | 420 } |
| 419 | 421 |
| 420 void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { | 422 void NativeWidgetAura::SetAlwaysOnTop(bool on_top) { |
| 421 // http://crbug.com/102582 | 423 window_->SetIntProperty(aura::kAlwaysOnTopKey, on_top); |
| 422 NOTIMPLEMENTED(); | |
| 423 } | 424 } |
| 424 | 425 |
| 425 void NativeWidgetAura::Maximize() { | 426 void NativeWidgetAura::Maximize() { |
| 426 window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 427 window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
| 427 } | 428 } |
| 428 | 429 |
| 429 void NativeWidgetAura::Minimize() { | 430 void NativeWidgetAura::Minimize() { |
| 430 NOTREACHED(); | 431 NOTREACHED(); |
| 431 } | 432 } |
| 432 | 433 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 732 |
| 732 // static | 733 // static |
| 733 bool NativeWidgetPrivate::IsMouseButtonDown() { | 734 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 734 // http://crbug.com/102577 | 735 // http://crbug.com/102577 |
| 735 NOTIMPLEMENTED(); | 736 NOTIMPLEMENTED(); |
| 736 return false; | 737 return false; |
| 737 } | 738 } |
| 738 | 739 |
| 739 } // namespace internal | 740 } // namespace internal |
| 740 } // namespace views | 741 } // namespace views |
| OLD | NEW |