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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/activation_change_observer.h" | 10 #include "ui/aura/client/activation_change_observer.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 gfx::NativeView parent = params.GetParent(); | 115 gfx::NativeView parent = params.GetParent(); |
116 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { | 116 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { |
117 parent->AddTransientChild(window_); | 117 parent->AddTransientChild(window_); |
118 parent = NULL; | 118 parent = NULL; |
119 } | 119 } |
120 // SetAlwaysOnTop before SetParent so that always-on-top container is used. | 120 // SetAlwaysOnTop before SetParent so that always-on-top container is used. |
121 SetAlwaysOnTop(params.keep_on_top); | 121 SetAlwaysOnTop(params.keep_on_top); |
122 // If the parent is not specified, find the default parent for | 122 // If the parent is not specified, find the default parent for |
123 // the |window_| using the desired |window_bounds|. | 123 // the |window_| using the desired |window_bounds|. |
124 if (!parent) { | 124 if (!parent) { |
125 parent = aura::client::GetStackingClient(params.GetParent())-> | 125 parent = aura::client::GetStackingClient()-> |
126 GetDefaultParent(window_, window_bounds); | 126 GetDefaultParent(params.context, window_, window_bounds); |
127 } else if (window_bounds == gfx::Rect()) { | 127 } else if (window_bounds == gfx::Rect()) { |
128 // If a parent is specified but no bounds are given, | 128 // If a parent is specified but no bounds are given, |
129 // use the origin of the parent's display so that the widget | 129 // use the origin of the parent's display so that the widget |
130 // will be added to the same display as the parent. | 130 // will be added to the same display as the parent. |
131 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)-> | 131 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)-> |
132 GetDisplayNearestWindow(parent).bounds(); | 132 GetDisplayNearestWindow(parent).bounds(); |
133 window_bounds.set_origin(bounds.origin()); | 133 window_bounds.set_origin(bounds.origin()); |
134 } | 134 } |
135 window_->SetParent(parent); | 135 window_->SetParent(parent); |
136 } | 136 } |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 return aura::Env::GetInstance()->is_mouse_button_down(); | 1002 return aura::Env::GetInstance()->is_mouse_button_down(); |
1003 } | 1003 } |
1004 | 1004 |
1005 // static | 1005 // static |
1006 bool NativeWidgetPrivate::IsTouchDown() { | 1006 bool NativeWidgetPrivate::IsTouchDown() { |
1007 return aura::Env::GetInstance()->is_touch_down(); | 1007 return aura::Env::GetInstance()->is_touch_down(); |
1008 } | 1008 } |
1009 | 1009 |
1010 } // namespace internal | 1010 } // namespace internal |
1011 } // namespace views | 1011 } // namespace views |
OLD | NEW |