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 "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "ui/aura/client/activation_client.h" | 9 #include "ui/aura/client/activation_client.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 aura::client::SetWindowTreeClient(root_window_, this); | 152 aura::client::SetWindowTreeClient(root_window_, this); |
153 } | 153 } |
154 virtual ~DesktopNativeWidgetAuraWindowTreeClient() { | 154 virtual ~DesktopNativeWidgetAuraWindowTreeClient() { |
155 aura::client::SetWindowTreeClient(root_window_, NULL); | 155 aura::client::SetWindowTreeClient(root_window_, NULL); |
156 } | 156 } |
157 | 157 |
158 // Overridden from client::WindowTreeClient: | 158 // Overridden from client::WindowTreeClient: |
159 virtual aura::Window* GetDefaultParent(aura::Window* context, | 159 virtual aura::Window* GetDefaultParent(aura::Window* context, |
160 aura::Window* window, | 160 aura::Window* window, |
161 const gfx::Rect& bounds) OVERRIDE { | 161 const gfx::Rect& bounds) OVERRIDE { |
162 bool full_screen = window->GetProperty(aura::client::kShowStateKey) == | 162 bool is_fullscreen = window->GetProperty(aura::client::kShowStateKey) == |
163 ui::SHOW_STATE_FULLSCREEN; | 163 ui::SHOW_STATE_FULLSCREEN; |
164 bool is_menu = false; | 164 bool is_menu = window->type() == aura::client::WINDOW_TYPE_MENU; |
165 // TODO(erg): We need to be able to spawn and deal with toplevel windows if | 165 if (is_fullscreen || is_menu) { |
166 // we want the popups to extend past our window | |
167 // bounds. http://crbug.com/288988 | |
168 #if !defined(OS_LINUX) | |
169 is_menu = window->type() == aura::client::WINDOW_TYPE_MENU; | |
170 #endif | |
171 if (full_screen || is_menu) { | |
172 return DesktopNativeWidgetTopLevelHandler::CreateParentWindow( | 166 return DesktopNativeWidgetTopLevelHandler::CreateParentWindow( |
173 window, bounds, full_screen); | 167 window, bounds, is_fullscreen); |
174 } | 168 } |
175 return root_window_; | 169 return root_window_; |
176 } | 170 } |
177 | 171 |
178 private: | 172 private: |
179 aura::Window* root_window_; | 173 aura::Window* root_window_; |
180 | 174 |
181 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAuraWindowTreeClient); | 175 DISALLOW_COPY_AND_ASSIGN(DesktopNativeWidgetAuraWindowTreeClient); |
182 }; | 176 }; |
183 | 177 |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 input_method_event_filter_->SetInputMethodPropertyInRootWindow( | 1106 input_method_event_filter_->SetInputMethodPropertyInRootWindow( |
1113 root_window_->window()); | 1107 root_window_->window()); |
1114 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); | 1108 root_window_event_filter_->AddHandler(input_method_event_filter_.get()); |
1115 } | 1109 } |
1116 | 1110 |
1117 void DesktopNativeWidgetAura::UpdateWindowTransparency() { | 1111 void DesktopNativeWidgetAura::UpdateWindowTransparency() { |
1118 content_window_->SetTransparent(ShouldUseNativeFrame()); | 1112 content_window_->SetTransparent(ShouldUseNativeFrame()); |
1119 } | 1113 } |
1120 | 1114 |
1121 } // namespace views | 1115 } // namespace views |
OLD | NEW |