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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { | 117 if (parent && parent->type() != aura::client::WINDOW_TYPE_UNKNOWN) { |
118 parent->AddTransientChild(window_); | 118 parent->AddTransientChild(window_); |
119 parent = NULL; | 119 parent = NULL; |
120 } | 120 } |
121 // SetAlwaysOnTop before SetParent so that always-on-top container is used. | 121 // SetAlwaysOnTop before SetParent so that always-on-top container is used. |
122 SetAlwaysOnTop(params.keep_on_top); | 122 SetAlwaysOnTop(params.keep_on_top); |
123 // If the parent is not specified, find the default parent for | 123 // If the parent is not specified, find the default parent for |
124 // the |window_| using the desired |window_bounds|. | 124 // the |window_| using the desired |window_bounds|. |
125 if (!parent) { | 125 if (!parent) { |
126 parent = aura::client::GetStackingClient(params.GetParent())-> | 126 parent = aura::client::GetStackingClient(params.GetParent())-> |
127 GetDefaultParent(window_, window_bounds); | 127 GetDefaultParent(params.context, window_, window_bounds); |
128 } else if (window_bounds == gfx::Rect()) { | 128 } else if (window_bounds == gfx::Rect()) { |
129 // If a parent is specified but no bounds are given, | 129 // If a parent is specified but no bounds are given, |
130 // use the origin of the parent's display so that the widget | 130 // use the origin of the parent's display so that the widget |
131 // will be added to the same display as the parent. | 131 // will be added to the same display as the parent. |
132 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)-> | 132 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)-> |
133 GetDisplayNearestWindow(parent).bounds(); | 133 GetDisplayNearestWindow(parent).bounds(); |
134 window_bounds.set_origin(bounds.origin()); | 134 window_bounds.set_origin(bounds.origin()); |
135 } | 135 } |
136 window_->SetParent(parent); | 136 window_->SetParent(parent); |
137 } | 137 } |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 return aura::Env::GetInstance()->is_mouse_button_down(); | 1020 return aura::Env::GetInstance()->is_mouse_button_down(); |
1021 } | 1021 } |
1022 | 1022 |
1023 // static | 1023 // static |
1024 bool NativeWidgetPrivate::IsTouchDown() { | 1024 bool NativeWidgetPrivate::IsTouchDown() { |
1025 return aura::Env::GetInstance()->is_touch_down(); | 1025 return aura::Env::GetInstance()->is_touch_down(); |
1026 } | 1026 } |
1027 | 1027 |
1028 } // namespace internal | 1028 } // namespace internal |
1029 } // namespace views | 1029 } // namespace views |
OLD | NEW |