| 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_native_widget_helper_aura.h" | 5 #include "ui/views/widget/desktop_native_widget_helper_aura.h" |
| 6 | 6 |
| 7 #include "ui/aura/root_window.h" | 7 #include "ui/aura/root_window.h" |
| 8 #include "ui/aura/desktop/desktop_activation_client.h" | 8 #include "ui/aura/desktop/desktop_activation_client.h" |
| 9 #include "ui/aura/desktop/desktop_dispatcher_client.h" | 9 #include "ui/aura/desktop/desktop_dispatcher_client.h" |
| 10 #include "ui/aura/client/dispatcher_client.h" | 10 #include "ui/aura/client/dispatcher_client.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 is_embedded_window_(false) { | 26 is_embedded_window_(false) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 DesktopNativeWidgetHelperAura::~DesktopNativeWidgetHelperAura() { | 29 DesktopNativeWidgetHelperAura::~DesktopNativeWidgetHelperAura() { |
| 30 if (root_window_event_filter_) | 30 if (root_window_event_filter_) |
| 31 root_window_event_filter_->RemoveFilter(input_method_filter_.get()); | 31 root_window_event_filter_->RemoveFilter(input_method_filter_.get()); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void DesktopNativeWidgetHelperAura::PreInitialize( | 34 void DesktopNativeWidgetHelperAura::PreInitialize( |
| 35 const Widget::InitParams& params) { | 35 const Widget::InitParams& params) { |
| 36 #if !defined(OS_WIN) |
| 36 // We don't want the status bubble or the omnibox to get their own root | 37 // We don't want the status bubble or the omnibox to get their own root |
| 37 // window on the desktop; on Linux | 38 // window on the desktop; on Linux |
| 38 // | 39 // |
| 39 // TODO(erg): This doesn't map perfectly to what I want to do. TYPE_POPUP is | 40 // TODO(erg): This doesn't map perfectly to what I want to do. TYPE_POPUP is |
| 40 // used for lots of stuff, like dragged tabs, and I only want this to trigger | 41 // used for lots of stuff, like dragged tabs, and I only want this to trigger |
| 41 // for the status bubble and the omnibox. | 42 // for the status bubble and the omnibox. |
| 42 if (params.type == Widget::InitParams::TYPE_POPUP) { | 43 if (params.type == Widget::InitParams::TYPE_POPUP) { |
| 43 is_embedded_window_ = true; | 44 is_embedded_window_ = true; |
| 44 return; | 45 return; |
| 45 } else if (params.type == Widget::InitParams::TYPE_CONTROL) { | 46 } else if (params.type == Widget::InitParams::TYPE_CONTROL) { |
| 46 return; | 47 return; |
| 47 } | 48 } |
| 49 #endif |
| 48 | 50 |
| 49 gfx::Rect bounds = params.bounds; | 51 gfx::Rect bounds = params.bounds; |
| 50 if (bounds.IsEmpty()) { | 52 if (bounds.IsEmpty()) { |
| 51 // We must pass some non-zero value when we initialize a RootWindow. This | 53 // We must pass some non-zero value when we initialize a RootWindow. This |
| 52 // will probably be SetBounds()ed soon. | 54 // will probably be SetBounds()ed soon. |
| 53 bounds.set_size(gfx::Size(100, 100)); | 55 bounds.set_size(gfx::Size(100, 100)); |
| 54 } | 56 } |
| 55 root_window_.reset(new aura::RootWindow(bounds)); | 57 root_window_.reset(new aura::RootWindow(bounds)); |
| 56 root_window_->Init(); | 58 root_window_->Init(); |
| 57 | 59 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 root->GetHostSize())); | 136 root->GetHostSize())); |
| 135 } | 137 } |
| 136 | 138 |
| 137 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( | 139 void DesktopNativeWidgetHelperAura::OnRootWindowHostClosed( |
| 138 const aura::RootWindow* root) { | 140 const aura::RootWindow* root) { |
| 139 DCHECK_EQ(root, root_window_.get()); | 141 DCHECK_EQ(root, root_window_.get()); |
| 140 widget_->GetWidget()->Close(); | 142 widget_->GetWidget()->Close(); |
| 141 } | 143 } |
| 142 | 144 |
| 143 } // namespace views | 145 } // namespace views |
| OLD | NEW |