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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 SetPropertyInternal( | 788 SetPropertyInternal( |
789 key, key, NULL, reinterpret_cast<int64>(value), 0); | 789 key, key, NULL, reinterpret_cast<int64>(value), 0); |
790 } | 790 } |
791 | 791 |
792 void* Window::GetNativeWindowProperty(const char* key) const { | 792 void* Window::GetNativeWindowProperty(const char* key) const { |
793 return reinterpret_cast<void*>(GetPropertyInternal(key, 0)); | 793 return reinterpret_cast<void*>(GetPropertyInternal(key, 0)); |
794 } | 794 } |
795 | 795 |
796 void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { | 796 void Window::OnDeviceScaleFactorChanged(float device_scale_factor) { |
797 ScopedCursorHider hider(this); | 797 ScopedCursorHider hider(this); |
798 if (IsRootWindow()) | |
799 host_->OnDeviceScaleFactorChanged(device_scale_factor); | |
800 if (delegate_) | 798 if (delegate_) |
801 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); | 799 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); |
802 } | 800 } |
803 | 801 |
804 #if !defined(NDEBUG) | 802 #if !defined(NDEBUG) |
805 std::string Window::GetDebugInfo() const { | 803 std::string Window::GetDebugInfo() const { |
806 return base::StringPrintf( | 804 return base::StringPrintf( |
807 "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", | 805 "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f", |
808 name().empty() ? "Unknown" : name().c_str(), id(), | 806 name().empty() ? "Unknown" : name().c_str(), id(), |
809 bounds().x(), bounds().y(), bounds().width(), bounds().height(), | 807 bounds().x(), bounds().y(), bounds().width(), bounds().height(), |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 return window; | 1443 return window; |
1446 if (offset) | 1444 if (offset) |
1447 *offset += window->bounds().OffsetFromOrigin(); | 1445 *offset += window->bounds().OffsetFromOrigin(); |
1448 } | 1446 } |
1449 if (offset) | 1447 if (offset) |
1450 *offset = gfx::Vector2d(); | 1448 *offset = gfx::Vector2d(); |
1451 return NULL; | 1449 return NULL; |
1452 } | 1450 } |
1453 | 1451 |
1454 } // namespace aura | 1452 } // namespace aura |
OLD | NEW |