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/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
11 #include "ui/aura/client/stacking_client.h" | 11 #include "ui/aura/client/stacking_client.h" |
12 #include "ui/aura/env.h" | |
12 #include "ui/aura/focus_manager.h" | 13 #include "ui/aura/focus_manager.h" |
13 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
14 #include "ui/aura/root_window_host.h" | 15 #include "ui/aura/root_window_host.h" |
15 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
16 #include "ui/aura/window_observer.h" | 17 #include "ui/aura/window_observer.h" |
17 #include "ui/aura/window_property.h" | 18 #include "ui/aura/window_property.h" |
18 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
19 #include "ui/compositor/layer.h" | 20 #include "ui/compositor/layer.h" |
20 #include "ui/gfx/canvas.h" | 21 #include "ui/gfx/canvas.h" |
21 #include "ui/gfx/display.h" | 22 #include "ui/gfx/display.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 } | 260 } |
260 } | 261 } |
261 | 262 |
262 //////////////////////////////////////////////////////////////////////////////// | 263 //////////////////////////////////////////////////////////////////////////////// |
263 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: | 264 // DesktopNativeWidgetAura, internal::NativeWidgetPrivate implementation: |
264 | 265 |
265 void DesktopNativeWidgetAura::InitNativeWidget( | 266 void DesktopNativeWidgetAura::InitNativeWidget( |
266 const Widget::InitParams& params) { | 267 const Widget::InitParams& params) { |
267 ownership_ = params.ownership; | 268 ownership_ = params.ownership; |
268 | 269 |
270 aura::Env::CreateInstance(); | |
Ben Goodger (Google)
2013/09/17 20:39:04
Seems like this should only be done once per proce
dnicoara
2013/09/17 21:01:27
I see. It probably could be moved higher, but not
| |
271 | |
269 NativeWidgetAura::RegisterNativeWidgetForWindow(this, window_); | 272 NativeWidgetAura::RegisterNativeWidgetForWindow(this, window_); |
270 // Animations on TYPE_WINDOW are handled by the OS. Additionally if we animate | 273 // Animations on TYPE_WINDOW are handled by the OS. Additionally if we animate |
271 // these windows the size of the window gets augmented, effecting restore | 274 // these windows the size of the window gets augmented, effecting restore |
272 // bounds and maximized windows in bad ways. | 275 // bounds and maximized windows in bad ways. |
273 if (params.type == Widget::InitParams::TYPE_WINDOW && | 276 if (params.type == Widget::InitParams::TYPE_WINDOW && |
274 !params.remove_standard_frame) { | 277 !params.remove_standard_frame) { |
275 window_->SetProperty(aura::client::kAnimationsDisabledKey, true); | 278 window_->SetProperty(aura::client::kAnimationsDisabledKey, true); |
276 } | 279 } |
277 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); | 280 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); |
278 window_->SetTransparent(true); | 281 window_->SetTransparent(true); |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 } | 946 } |
944 | 947 |
945 //////////////////////////////////////////////////////////////////////////////// | 948 //////////////////////////////////////////////////////////////////////////////// |
946 // DesktopNativeWidgetAura, NativeWidget implementation: | 949 // DesktopNativeWidgetAura, NativeWidget implementation: |
947 | 950 |
948 ui::EventHandler* DesktopNativeWidgetAura::GetEventHandler() { | 951 ui::EventHandler* DesktopNativeWidgetAura::GetEventHandler() { |
949 return this; | 952 return this; |
950 } | 953 } |
951 | 954 |
952 } // namespace views | 955 } // namespace views |
OLD | NEW |