| 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/native_widget_aura.h" | 5 #include "ui/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 "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "ui/views/ime/input_method_bridge.h" | 32 #include "ui/views/ime/input_method_bridge.h" |
| 33 #include "ui/views/views_delegate.h" | 33 #include "ui/views/views_delegate.h" |
| 34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 34 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 35 #include "ui/views/widget/drop_helper.h" | 35 #include "ui/views/widget/drop_helper.h" |
| 36 #include "ui/views/widget/native_widget_aura_window_observer.h" | 36 #include "ui/views/widget/native_widget_aura_window_observer.h" |
| 37 #include "ui/views/widget/native_widget_delegate.h" | 37 #include "ui/views/widget/native_widget_delegate.h" |
| 38 #include "ui/views/widget/root_view.h" | 38 #include "ui/views/widget/root_view.h" |
| 39 #include "ui/views/widget/tooltip_manager_aura.h" | 39 #include "ui/views/widget/tooltip_manager_aura.h" |
| 40 #include "ui/views/widget/widget_aura_utils.h" | 40 #include "ui/views/widget/widget_aura_utils.h" |
| 41 #include "ui/views/widget/widget_delegate.h" | 41 #include "ui/views/widget/widget_delegate.h" |
| 42 #include "ui/views/widget/window_reorderer.h" |
| 42 | 43 |
| 43 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
| 44 #include "base/win/scoped_gdi_object.h" | 45 #include "base/win/scoped_gdi_object.h" |
| 45 #include "base/win/win_util.h" | 46 #include "base/win/win_util.h" |
| 46 #include "ui/base/l10n/l10n_util_win.h" | 47 #include "ui/base/l10n/l10n_util_win.h" |
| 47 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" | 48 #include "ui/views/widget/desktop_aura/desktop_root_window_host_win.h" |
| 48 #endif | 49 #endif |
| 49 | 50 |
| 50 #if !defined(OS_CHROMEOS) | 51 #if !defined(OS_CHROMEOS) |
| 51 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" | 52 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 params.type != Widget::InitParams::TYPE_POPUP) { | 166 params.type != Widget::InitParams::TYPE_POPUP) { |
| 166 aura::client::SetDragDropDelegate(window_, this); | 167 aura::client::SetDragDropDelegate(window_, this); |
| 167 } | 168 } |
| 168 | 169 |
| 169 aura::client::SetActivationDelegate(window_, this); | 170 aura::client::SetActivationDelegate(window_, this); |
| 170 | 171 |
| 171 window_->SetProperty(aura::client::kCanMaximizeKey, | 172 window_->SetProperty(aura::client::kCanMaximizeKey, |
| 172 GetWidget()->widget_delegate()->CanMaximize()); | 173 GetWidget()->widget_delegate()->CanMaximize()); |
| 173 window_->SetProperty(aura::client::kCanResizeKey, | 174 window_->SetProperty(aura::client::kCanResizeKey, |
| 174 GetWidget()->widget_delegate()->CanResize()); | 175 GetWidget()->widget_delegate()->CanResize()); |
| 176 |
| 177 window_reorderer_.reset(new WindowReorderer(window_, |
| 178 GetWidget()->GetRootView())); |
| 175 } | 179 } |
| 176 | 180 |
| 177 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { | 181 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { |
| 178 return NULL; | 182 return NULL; |
| 179 } | 183 } |
| 180 | 184 |
| 181 bool NativeWidgetAura::ShouldUseNativeFrame() const { | 185 bool NativeWidgetAura::ShouldUseNativeFrame() const { |
| 182 // There is only one frame type for aura. | 186 // There is only one frame type for aura. |
| 183 return false; | 187 return false; |
| 184 } | 188 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 220 } |
| 217 | 221 |
| 218 ui::Compositor* NativeWidgetAura::GetCompositor() { | 222 ui::Compositor* NativeWidgetAura::GetCompositor() { |
| 219 return window_->layer()->GetCompositor(); | 223 return window_->layer()->GetCompositor(); |
| 220 } | 224 } |
| 221 | 225 |
| 222 ui::Layer* NativeWidgetAura::GetLayer() { | 226 ui::Layer* NativeWidgetAura::GetLayer() { |
| 223 return window_->layer(); | 227 return window_->layer(); |
| 224 } | 228 } |
| 225 | 229 |
| 230 void NativeWidgetAura::ReorderNativeViews() { |
| 231 window_reorderer_->ReorderChildWindows(); |
| 232 } |
| 233 |
| 226 void NativeWidgetAura::ViewRemoved(View* view) { | 234 void NativeWidgetAura::ViewRemoved(View* view) { |
| 227 DCHECK(drop_helper_.get() != NULL); | 235 DCHECK(drop_helper_.get() != NULL); |
| 228 drop_helper_->ResetTargetViewIfEquals(view); | 236 drop_helper_->ResetTargetViewIfEquals(view); |
| 229 } | 237 } |
| 230 | 238 |
| 231 void NativeWidgetAura::SetNativeWindowProperty(const char* name, void* value) { | 239 void NativeWidgetAura::SetNativeWindowProperty(const char* name, void* value) { |
| 232 if (window_) | 240 if (window_) |
| 233 window_->SetNativeWindowProperty(name, value); | 241 window_->SetNativeWindowProperty(name, value); |
| 234 } | 242 } |
| 235 | 243 |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 return aura::Env::GetInstance()->is_mouse_button_down(); | 1040 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1033 } | 1041 } |
| 1034 | 1042 |
| 1035 // static | 1043 // static |
| 1036 bool NativeWidgetPrivate::IsTouchDown() { | 1044 bool NativeWidgetPrivate::IsTouchDown() { |
| 1037 return aura::Env::GetInstance()->is_touch_down(); | 1045 return aura::Env::GetInstance()->is_touch_down(); |
| 1038 } | 1046 } |
| 1039 | 1047 |
| 1040 } // namespace internal | 1048 } // namespace internal |
| 1041 } // namespace views | 1049 } // namespace views |
| OLD | NEW |