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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 explicit DesktopNativeWidgetAuraWindowParentingClient( | 174 explicit DesktopNativeWidgetAuraWindowParentingClient( |
175 aura::Window* root_window) | 175 aura::Window* root_window) |
176 : root_window_(root_window) { | 176 : root_window_(root_window) { |
177 aura::client::SetWindowParentingClient(root_window_, this); | 177 aura::client::SetWindowParentingClient(root_window_, this); |
178 } | 178 } |
179 ~DesktopNativeWidgetAuraWindowParentingClient() override { | 179 ~DesktopNativeWidgetAuraWindowParentingClient() override { |
180 aura::client::SetWindowParentingClient(root_window_, NULL); | 180 aura::client::SetWindowParentingClient(root_window_, NULL); |
181 } | 181 } |
182 | 182 |
183 // Overridden from client::WindowParentingClient: | 183 // Overridden from client::WindowParentingClient: |
184 aura::Window* GetDefaultParent(aura::Window* context, | 184 aura::Window* GetDefaultParent(aura::Window* window, |
185 aura::Window* window, | |
186 const gfx::Rect& bounds) override { | 185 const gfx::Rect& bounds) override { |
187 bool is_fullscreen = window->GetProperty(aura::client::kShowStateKey) == | 186 bool is_fullscreen = window->GetProperty(aura::client::kShowStateKey) == |
188 ui::SHOW_STATE_FULLSCREEN; | 187 ui::SHOW_STATE_FULLSCREEN; |
189 bool is_menu = window->type() == ui::wm::WINDOW_TYPE_MENU; | 188 bool is_menu = window->type() == ui::wm::WINDOW_TYPE_MENU; |
190 | 189 |
191 if (is_fullscreen || is_menu) { | 190 if (is_fullscreen || is_menu) { |
192 bool root_is_always_on_top = false; | 191 bool root_is_always_on_top = false; |
193 internal::NativeWidgetPrivate* native_widget = | 192 internal::NativeWidgetPrivate* native_widget = |
194 DesktopNativeWidgetAura::ForWindow(root_window_); | 193 DesktopNativeWidgetAura::ForWindow(root_window_); |
195 if (native_widget) | 194 if (native_widget) |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 if (cursor_reference_count_ == 0) { | 1207 if (cursor_reference_count_ == 0) { |
1209 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1208 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
1210 // for cleaning up |cursor_manager_|. | 1209 // for cleaning up |cursor_manager_|. |
1211 delete cursor_manager_; | 1210 delete cursor_manager_; |
1212 native_cursor_manager_ = NULL; | 1211 native_cursor_manager_ = NULL; |
1213 cursor_manager_ = NULL; | 1212 cursor_manager_ = NULL; |
1214 } | 1213 } |
1215 } | 1214 } |
1216 | 1215 |
1217 } // namespace views | 1216 } // namespace views |
OLD | NEW |