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/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 void* Window::GetNativeWindowProperty(const char* key) const { | 798 void* Window::GetNativeWindowProperty(const char* key) const { |
799 return reinterpret_cast<void*>(GetPropertyInternal(key, 0)); | 799 return reinterpret_cast<void*>(GetPropertyInternal(key, 0)); |
800 } | 800 } |
801 | 801 |
802 void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { | 802 void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { |
803 ScopedCursorHider hider(this); | 803 ScopedCursorHider hider(this); |
804 if (delegate_) | 804 if (delegate_) |
805 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); | 805 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); |
806 } | 806 } |
807 | 807 |
| 808 ui::EventTargeter* Window::GetEventTargeter() { |
| 809 return targeter_.get(); |
| 810 } |
| 811 |
808 #if !defined(NDEBUG) | 812 #if !defined(NDEBUG) |
809 std::string Window::GetDebugInfo() const { | 813 std::string Window::GetDebugInfo() const { |
810 return base::StringPrintf( | 814 return base::StringPrintf( |
811 "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", | 815 "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", |
812 name().empty() ? "Unknown" : name().c_str(), id(), | 816 name().empty() ? "Unknown" : name().c_str(), id(), |
813 bounds().x(), bounds().y(), bounds().width(), bounds().height(), | 817 bounds().x(), bounds().y(), bounds().width(), bounds().height(), |
814 visible_ ? "WindowVisible" : "WindowHidden", | 818 visible_ ? "WindowVisible" : "WindowHidden", |
815 layer() ? | 819 layer() ? |
816 (layer()->GetTargetVisibility() ? "LayerVisible" : "LayerHidden") : | 820 (layer()->GetTargetVisibility() ? "LayerVisible" : "LayerHidden") : |
817 "NoLayer", | 821 "NoLayer", |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 client::GetEventClient(this)->GetToplevelEventTarget() : | 1426 client::GetEventClient(this)->GetToplevelEventTarget() : |
1423 Env::GetInstance(); | 1427 Env::GetInstance(); |
1424 } | 1428 } |
1425 return parent_; | 1429 return parent_; |
1426 } | 1430 } |
1427 | 1431 |
1428 scoped_ptr<ui::EventTargetIterator> Window::GetChildIterator() const { | 1432 scoped_ptr<ui::EventTargetIterator> Window::GetChildIterator() const { |
1429 return make_scoped_ptr(new ui::EventTargetIteratorImpl<Window>(children())); | 1433 return make_scoped_ptr(new ui::EventTargetIteratorImpl<Window>(children())); |
1430 } | 1434 } |
1431 | 1435 |
1432 ui::EventTargeter* Window::GetEventTargeter() { | |
1433 return targeter_.get(); | |
1434 } | |
1435 | |
1436 void Window::ConvertEventToTarget(ui::EventTarget* target, | 1436 void Window::ConvertEventToTarget(ui::EventTarget* target, |
1437 ui::LocatedEvent* event) { | 1437 ui::LocatedEvent* event) { |
1438 event->ConvertLocationToTarget(this, | 1438 event->ConvertLocationToTarget(this, |
1439 static_cast<Window*>(target)); | 1439 static_cast<Window*>(target)); |
1440 } | 1440 } |
1441 | 1441 |
1442 void Window::UpdateLayerName() { | 1442 void Window::UpdateLayerName() { |
1443 #if !defined(NDEBUG) | 1443 #if !defined(NDEBUG) |
1444 DCHECK(layer()); | 1444 DCHECK(layer()); |
1445 | 1445 |
(...skipping 14 matching lines...) Expand all Loading... |
1460 return window; | 1460 return window; |
1461 if (offset) | 1461 if (offset) |
1462 *offset += window->bounds().OffsetFromOrigin(); | 1462 *offset += window->bounds().OffsetFromOrigin(); |
1463 } | 1463 } |
1464 if (offset) | 1464 if (offset) |
1465 *offset = gfx::Vector2d(); | 1465 *offset = gfx::Vector2d(); |
1466 return NULL; | 1466 return NULL; |
1467 } | 1467 } |
1468 | 1468 |
1469 } // namespace aura | 1469 } // namespace aura |
OLD | NEW |