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/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/client/activation_client.h" | 8 #include "ui/aura/client/activation_client.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/stacking_client.h" | 10 #include "ui/aura/client/stacking_client.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 #if defined(OS_LINUX) // TODO(scottmg): http://crbug.com/180071 | 228 #if defined(OS_LINUX) // TODO(scottmg): http://crbug.com/180071 |
229 window_->Show(); | 229 window_->Show(); |
230 #endif | 230 #endif |
231 | 231 |
232 desktop_root_window_host_ = params.desktop_root_window_host ? | 232 desktop_root_window_host_ = params.desktop_root_window_host ? |
233 params.desktop_root_window_host : | 233 params.desktop_root_window_host : |
234 DesktopRootWindowHost::Create(native_widget_delegate_, | 234 DesktopRootWindowHost::Create(native_widget_delegate_, |
235 this, params.bounds); | 235 this, params.bounds); |
236 root_window_.reset( | 236 root_window_.reset( |
237 desktop_root_window_host_->Init(window_, params)); | 237 desktop_root_window_host_->Init(window_, params)); |
238 root_window_->AddRootWindowObserver(this); | |
sky
2013/05/29 00:05:31
I like things that are balanced. Can you remove th
Elliot Glaysher
2013/05/29 00:11:05
Done.
| |
239 | |
238 stacking_client_.reset( | 240 stacking_client_.reset( |
239 new DesktopNativeWidgetAuraStackingClient(root_window_.get())); | 241 new DesktopNativeWidgetAuraStackingClient(root_window_.get())); |
240 drop_helper_.reset(new DropHelper( | 242 drop_helper_.reset(new DropHelper( |
241 static_cast<internal::RootView*>(GetWidget()->GetRootView()))); | 243 static_cast<internal::RootView*>(GetWidget()->GetRootView()))); |
242 aura::client::SetDragDropDelegate(window_, this); | 244 aura::client::SetDragDropDelegate(window_, this); |
243 | 245 |
244 tooltip_manager_.reset(new views::TooltipManagerAura(window_, GetWidget())); | 246 tooltip_manager_.reset(new views::TooltipManagerAura(window_, GetWidget())); |
245 tooltip_controller_.reset( | 247 tooltip_controller_.reset( |
246 new corewm::TooltipController(gfx::SCREEN_TYPE_NATIVE)); | 248 new corewm::TooltipController(gfx::SCREEN_TYPE_NATIVE)); |
247 aura::client::SetTooltipClient(root_window_.get(), | 249 aura::client::SetTooltipClient(root_window_.get(), |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
835 DCHECK(drop_helper_.get() != NULL); | 837 DCHECK(drop_helper_.get() != NULL); |
836 drop_helper_->OnDragExit(); | 838 drop_helper_->OnDragExit(); |
837 } | 839 } |
838 | 840 |
839 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { | 841 int DesktopNativeWidgetAura::OnPerformDrop(const ui::DropTargetEvent& event) { |
840 DCHECK(drop_helper_.get() != NULL); | 842 DCHECK(drop_helper_.get() != NULL); |
841 return drop_helper_->OnDrop(event.data(), event.location(), | 843 return drop_helper_->OnDrop(event.data(), event.location(), |
842 last_drop_operation_); | 844 last_drop_operation_); |
843 } | 845 } |
844 | 846 |
847 //////////////////////////////////////////////////////////////////////////////// | |
848 // DesktopNativeWidgetAura, aura::RootWindowObserver implementation: | |
849 | |
850 void DesktopNativeWidgetAura::OnRootWindowHostCloseRequested( | |
851 const aura::RootWindow* root) { | |
852 Close(); | |
853 } | |
854 | |
845 } // namespace views | 855 } // namespace views |
OLD | NEW |