| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 aura::client::ScreenPositionClient* screen_position_client = | 290 aura::client::ScreenPositionClient* screen_position_client = |
| 291 aura::client::GetScreenPositionClient(window_->GetRootWindow()); | 291 aura::client::GetScreenPositionClient(window_->GetRootWindow()); |
| 292 if (screen_position_client) { | 292 if (screen_position_client) { |
| 293 gfx::Point origin = work_area.origin(); | 293 gfx::Point origin = work_area.origin(); |
| 294 screen_position_client->ConvertPointFromScreen(window_->GetRootWindow(), | 294 screen_position_client->ConvertPointFromScreen(window_->GetRootWindow(), |
| 295 &origin); | 295 &origin); |
| 296 work_area.set_origin(origin); | 296 work_area.set_origin(origin); |
| 297 } | 297 } |
| 298 | 298 |
| 299 parent_bounds = parent_bounds.Intersect(work_area); | 299 parent_bounds.Intersect(work_area); |
| 300 | 300 |
| 301 // If |window_|'s transient parent's bounds are big enough to fit it, then we | 301 // If |window_|'s transient parent's bounds are big enough to fit it, then we |
| 302 // center it with respect to the transient parent. | 302 // center it with respect to the transient parent. |
| 303 if (window_->transient_parent()) { | 303 if (window_->transient_parent()) { |
| 304 gfx::Rect transient_parent_rect = window_->transient_parent()-> | 304 gfx::Rect transient_parent_rect = window_->transient_parent()-> |
| 305 GetBoundsInRootWindow().Intersect(work_area); | 305 GetBoundsInRootWindow().Intersect(work_area); |
| 306 if (transient_parent_rect.height() >= size.height() && | 306 if (transient_parent_rect.height() >= size.height() && |
| 307 transient_parent_rect.width() >= size.width()) | 307 transient_parent_rect.width() >= size.width()) |
| 308 parent_bounds = transient_parent_rect; | 308 parent_bounds = transient_parent_rect; |
| 309 } | 309 } |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 return aura::Env::GetInstance()->is_mouse_button_down(); | 1004 return aura::Env::GetInstance()->is_mouse_button_down(); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 // static | 1007 // static |
| 1008 bool NativeWidgetPrivate::IsTouchDown() { | 1008 bool NativeWidgetPrivate::IsTouchDown() { |
| 1009 return aura::Env::GetInstance()->is_touch_down(); | 1009 return aura::Env::GetInstance()->is_touch_down(); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 } // namespace internal | 1012 } // namespace internal |
| 1013 } // namespace views | 1013 } // namespace views |
| OLD | NEW |