| 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/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
| (...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2020 &border_width, &depth)) { | 2020 &border_width, &depth)) { |
| 2021 NOTIMPLEMENTED(); | 2021 NOTIMPLEMENTED(); |
| 2022 return gfx::Rect(0, 0, 10, 10); | 2022 return gfx::Rect(0, 0, 10, 10); |
| 2023 } | 2023 } |
| 2024 | 2024 |
| 2025 return gfx::Rect(x, y, width, height); | 2025 return gfx::Rect(x, y, width, height); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 gfx::Rect DesktopWindowTreeHostX11::ToDIPRect( | 2028 gfx::Rect DesktopWindowTreeHostX11::ToDIPRect( |
| 2029 const gfx::Rect& rect_in_pixels) const { | 2029 const gfx::Rect& rect_in_pixels) const { |
| 2030 gfx::RectF rect_in_dip = rect_in_pixels; | 2030 gfx::RectF rect_in_dip = gfx::RectF(rect_in_pixels); |
| 2031 GetRootTransform().TransformRectReverse(&rect_in_dip); | 2031 GetRootTransform().TransformRectReverse(&rect_in_dip); |
| 2032 return gfx::ToEnclosingRect(rect_in_dip); | 2032 return gfx::ToEnclosingRect(rect_in_dip); |
| 2033 } | 2033 } |
| 2034 | 2034 |
| 2035 gfx::Rect DesktopWindowTreeHostX11::ToPixelRect( | 2035 gfx::Rect DesktopWindowTreeHostX11::ToPixelRect( |
| 2036 const gfx::Rect& rect_in_dip) const { | 2036 const gfx::Rect& rect_in_dip) const { |
| 2037 gfx::RectF rect_in_pixels = rect_in_dip; | 2037 gfx::RectF rect_in_pixels = gfx::RectF(rect_in_dip); |
| 2038 GetRootTransform().TransformRect(&rect_in_pixels); | 2038 GetRootTransform().TransformRect(&rect_in_pixels); |
| 2039 return gfx::ToEnclosingRect(rect_in_pixels); | 2039 return gfx::ToEnclosingRect(rect_in_pixels); |
| 2040 } | 2040 } |
| 2041 | 2041 |
| 2042 //////////////////////////////////////////////////////////////////////////////// | 2042 //////////////////////////////////////////////////////////////////////////////// |
| 2043 // DesktopWindowTreeHost, public: | 2043 // DesktopWindowTreeHost, public: |
| 2044 | 2044 |
| 2045 // static | 2045 // static |
| 2046 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 2046 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 2047 internal::NativeWidgetDelegate* native_widget_delegate, | 2047 internal::NativeWidgetDelegate* native_widget_delegate, |
| 2048 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 2048 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 2049 return new DesktopWindowTreeHostX11(native_widget_delegate, | 2049 return new DesktopWindowTreeHostX11(native_widget_delegate, |
| 2050 desktop_native_widget_aura); | 2050 desktop_native_widget_aura); |
| 2051 } | 2051 } |
| 2052 | 2052 |
| 2053 // static | 2053 // static |
| 2054 ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) { | 2054 ui::NativeTheme* DesktopWindowTreeHost::GetNativeTheme(aura::Window* window) { |
| 2055 const views::LinuxUI* linux_ui = views::LinuxUI::instance(); | 2055 const views::LinuxUI* linux_ui = views::LinuxUI::instance(); |
| 2056 if (linux_ui) { | 2056 if (linux_ui) { |
| 2057 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2057 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 2058 if (native_theme) | 2058 if (native_theme) |
| 2059 return native_theme; | 2059 return native_theme; |
| 2060 } | 2060 } |
| 2061 | 2061 |
| 2062 return ui::NativeTheme::instance(); | 2062 return ui::NativeTheme::instance(); |
| 2063 } | 2063 } |
| 2064 | 2064 |
| 2065 } // namespace views | 2065 } // namespace views |
| OLD | NEW |