| 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 "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/client/drag_drop_client.h" | 10 #include "ui/aura/client/drag_drop_client.h" |
| 11 #include "ui/aura/client/shadow_types.h" |
| 11 #include "ui/aura/desktop.h" | 12 #include "ui/aura/desktop.h" |
| 12 #include "ui/aura/desktop_observer.h" | 13 #include "ui/aura/desktop_observer.h" |
| 13 #include "ui/aura/event.h" | 14 #include "ui/aura/event.h" |
| 14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 15 #include "ui/aura/window_types.h" | 16 #include "ui/aura/window_types.h" |
| 16 #include "ui/base/dragdrop/os_exchange_data.h" | 17 #include "ui/base/dragdrop/os_exchange_data.h" |
| 17 #include "ui/base/ui_base_types.h" | 18 #include "ui/base/ui_base_types.h" |
| 18 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
| 19 #include "ui/gfx/compositor/layer.h" | 20 #include "ui/gfx/compositor/layer.h" |
| 20 #include "ui/gfx/font.h" | 21 #include "ui/gfx/font.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 window_->set_ignore_events(!params.accept_events); | 154 window_->set_ignore_events(!params.accept_events); |
| 154 // TODO(beng): do this some other way. | 155 // TODO(beng): do this some other way. |
| 155 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); | 156 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); |
| 156 can_activate_ = params.can_activate; | 157 can_activate_ = params.can_activate; |
| 157 DCHECK(GetWidget()->GetRootView()); | 158 DCHECK(GetWidget()->GetRootView()); |
| 158 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { | 159 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { |
| 159 views::TooltipManagerViews* manager = new views::TooltipManagerViews( | 160 views::TooltipManagerViews* manager = new views::TooltipManagerViews( |
| 160 GetWidget()->GetRootView()); | 161 GetWidget()->GetRootView()); |
| 161 tooltip_manager_.reset(manager); | 162 tooltip_manager_.reset(manager); |
| 162 } | 163 } |
| 164 |
| 163 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); | 165 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); |
| 164 if (params.type != Widget::InitParams::TYPE_TOOLTIP && | 166 if (params.type != Widget::InitParams::TYPE_TOOLTIP && |
| 165 params.type != Widget::InitParams::TYPE_POPUP) { | 167 params.type != Widget::InitParams::TYPE_POPUP) { |
| 166 window_->SetProperty(aura::kDragDropDelegateKey, | 168 window_->SetProperty(aura::kDragDropDelegateKey, |
| 167 static_cast<aura::WindowDragDropDelegate*>(this)); | 169 static_cast<aura::WindowDragDropDelegate*>(this)); |
| 168 } | 170 } |
| 171 |
| 172 if (window_type == Widget::InitParams::TYPE_MENU) |
| 173 window_->SetIntProperty(aura::kShadowTypeKey, |
| 174 aura::SHADOW_TYPE_RECTANGULAR); |
| 169 } | 175 } |
| 170 | 176 |
| 171 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { | 177 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { |
| 172 return NULL; | 178 return NULL; |
| 173 } | 179 } |
| 174 | 180 |
| 175 void NativeWidgetAura::UpdateFrameAfterFrameChange() { | 181 void NativeWidgetAura::UpdateFrameAfterFrameChange() { |
| 176 // We don't support changing the frame type. | 182 // We don't support changing the frame type. |
| 177 NOTREACHED(); | 183 NOTREACHED(); |
| 178 } | 184 } |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 NOTIMPLEMENTED(); | 791 NOTIMPLEMENTED(); |
| 786 } | 792 } |
| 787 | 793 |
| 788 // static | 794 // static |
| 789 bool NativeWidgetPrivate::IsMouseButtonDown() { | 795 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 790 return aura::Desktop::GetInstance()->IsMouseButtonDown(); | 796 return aura::Desktop::GetInstance()->IsMouseButtonDown(); |
| 791 } | 797 } |
| 792 | 798 |
| 793 } // namespace internal | 799 } // namespace internal |
| 794 } // namespace views | 800 } // namespace views |
| OLD | NEW |