| 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_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 #endif // !defined(OS_MACOSX) | 226 #endif // !defined(OS_MACOSX) |
| 227 | 227 |
| 228 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); | 228 drop_helper_.reset(new DropHelper(GetWidget()->GetRootView())); |
| 229 if (params.type != Widget::InitParams::TYPE_TOOLTIP && | 229 if (params.type != Widget::InitParams::TYPE_TOOLTIP && |
| 230 params.type != Widget::InitParams::TYPE_POPUP) { | 230 params.type != Widget::InitParams::TYPE_POPUP) { |
| 231 aura::client::SetDragDropDelegate(window_, this); | 231 aura::client::SetDragDropDelegate(window_, this); |
| 232 } | 232 } |
| 233 | 233 |
| 234 aura::client::SetActivationDelegate(window_, this); | 234 aura::client::SetActivationDelegate(window_, this); |
| 235 | 235 |
| 236 if (desktop_helper_.get()) { | 236 if (desktop_helper_.get()) |
| 237 desktop_helper_->PostInitialize(); | 237 desktop_helper_->PostInitialize(); |
| 238 // TODO(erg): Move this somewhere else? | |
| 239 desktop_helper_->ShowRootWindow(); | |
| 240 } | |
| 241 } | 238 } |
| 242 | 239 |
| 243 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { | 240 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { |
| 244 return NULL; | 241 return NULL; |
| 245 } | 242 } |
| 246 | 243 |
| 247 void NativeWidgetAura::UpdateFrameAfterFrameChange() { | 244 void NativeWidgetAura::UpdateFrameAfterFrameChange() { |
| 248 } | 245 } |
| 249 | 246 |
| 250 bool NativeWidgetAura::ShouldUseNativeFrame() const { | 247 bool NativeWidgetAura::ShouldUseNativeFrame() const { |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); | 654 return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area(); |
| 658 } | 655 } |
| 659 | 656 |
| 660 void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) { | 657 void NativeWidgetAura::SetInactiveRenderingDisabled(bool value) { |
| 661 if (!value) | 658 if (!value) |
| 662 active_window_observer_.reset(); | 659 active_window_observer_.reset(); |
| 663 else | 660 else |
| 664 active_window_observer_.reset(new ActiveWindowObserver(this)); | 661 active_window_observer_.reset(new ActiveWindowObserver(this)); |
| 665 } | 662 } |
| 666 | 663 |
| 667 Widget::MoveLoopResult NativeWidgetAura::RunMoveLoop() { | 664 Widget::MoveLoopResult NativeWidgetAura::RunMoveLoop( |
| 665 const gfx::Point& drag_offset) { |
| 668 if (window_->parent() && | 666 if (window_->parent() && |
| 669 aura::client::GetWindowMoveClient(window_->parent())) { | 667 aura::client::GetWindowMoveClient(window_->parent())) { |
| 670 SetCapture(); | 668 SetCapture(); |
| 671 aura::client::GetWindowMoveClient(window_->parent())->RunMoveLoop(window_); | 669 aura::client::GetWindowMoveClient(window_->parent())->RunMoveLoop( |
| 670 window_, drag_offset); |
| 672 return Widget::MOVE_LOOP_SUCCESSFUL; | 671 return Widget::MOVE_LOOP_SUCCESSFUL; |
| 673 } | 672 } |
| 674 return Widget::MOVE_LOOP_CANCELED; | 673 return Widget::MOVE_LOOP_CANCELED; |
| 675 } | 674 } |
| 676 | 675 |
| 677 void NativeWidgetAura::EndMoveLoop() { | 676 void NativeWidgetAura::EndMoveLoop() { |
| 678 if (window_->parent() && | 677 if (window_->parent() && |
| 679 aura::client::GetWindowMoveClient(window_->parent())) { | 678 aura::client::GetWindowMoveClient(window_->parent())) { |
| 680 aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop(); | 679 aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop(); |
| 681 } | 680 } |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 return aura::Env::GetInstance()->is_mouse_button_down(); | 1045 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1047 } | 1046 } |
| 1048 | 1047 |
| 1049 // static | 1048 // static |
| 1050 bool NativeWidgetPrivate::IsTouchDown() { | 1049 bool NativeWidgetPrivate::IsTouchDown() { |
| 1051 return aura::Env::GetInstance()->is_touch_down(); | 1050 return aura::Env::GetInstance()->is_touch_down(); |
| 1052 } | 1051 } |
| 1053 | 1052 |
| 1054 } // namespace internal | 1053 } // namespace internal |
| 1055 } // namespace views | 1054 } // namespace views |
| OLD | NEW |