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_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 gfx::Rect new_expanded( | 538 gfx::Rect new_expanded( |
539 expanded.origin(), | 539 expanded.origin(), |
540 GetExpandedWindowSize(message_handler_->window_ex_style(), | 540 GetExpandedWindowSize(message_handler_->window_ex_style(), |
541 expanded.size())); | 541 expanded.size())); |
542 window_enlargement_ = | 542 window_enlargement_ = |
543 gfx::Vector2d(new_expanded.width() - expanded.width(), | 543 gfx::Vector2d(new_expanded.width() - expanded.width(), |
544 new_expanded.height() - expanded.height()); | 544 new_expanded.height() - expanded.height()); |
545 message_handler_->SetBounds(new_expanded, old_content_size != bounds.size()); | 545 message_handler_->SetBounds(new_expanded, old_content_size != bounds.size()); |
546 } | 546 } |
547 | 547 |
548 gfx::Point DesktopWindowTreeHostWin::GetLocationOnNativeScreen() const { | 548 gfx::Point DesktopWindowTreeHostWin::GetLocationOnNativeScreenInPixels() const { |
549 return GetBounds().origin(); | 549 return GetBounds().origin(); |
550 } | 550 } |
551 | 551 |
552 void DesktopWindowTreeHostWin::SetCapture() { | 552 void DesktopWindowTreeHostWin::SetCapture() { |
553 message_handler_->SetCapture(); | 553 message_handler_->SetCapture(); |
554 } | 554 } |
555 | 555 |
556 void DesktopWindowTreeHostWin::ReleaseCapture() { | 556 void DesktopWindowTreeHostWin::ReleaseCapture() { |
557 message_handler_->ReleaseCapture(); | 557 message_handler_->ReleaseCapture(); |
558 } | 558 } |
559 | 559 |
560 void DesktopWindowTreeHostWin::SetCursorNative(gfx::NativeCursor cursor) { | 560 void DesktopWindowTreeHostWin::SetCursorNative(gfx::NativeCursor cursor) { |
561 ui::CursorLoaderWin cursor_loader; | 561 ui::CursorLoaderWin cursor_loader; |
562 cursor_loader.SetPlatformCursor(&cursor); | 562 cursor_loader.SetPlatformCursor(&cursor); |
563 | 563 |
564 message_handler_->SetCursor(cursor.platform()); | 564 message_handler_->SetCursor(cursor.platform()); |
565 } | 565 } |
566 | 566 |
567 void DesktopWindowTreeHostWin::OnCursorVisibilityChangedNative(bool show) { | 567 void DesktopWindowTreeHostWin::OnCursorVisibilityChangedNative(bool show) { |
568 if (is_cursor_visible_ == show) | 568 if (is_cursor_visible_ == show) |
569 return; | 569 return; |
570 is_cursor_visible_ = show; | 570 is_cursor_visible_ = show; |
571 ::ShowCursor(!!show); | 571 ::ShowCursor(!!show); |
572 } | 572 } |
573 | 573 |
574 void DesktopWindowTreeHostWin::MoveCursorToNative(const gfx::Point& location) { | 574 void DesktopWindowTreeHostWin::MoveCursorToNativeInPixels( |
575 POINT cursor_location = location.ToPOINT(); | 575 const gfx::Point& location_in_pixels) { |
| 576 POINT cursor_location = location_in_pixels.ToPOINT(); |
576 ::ClientToScreen(GetHWND(), &cursor_location); | 577 ::ClientToScreen(GetHWND(), &cursor_location); |
577 ::SetCursorPos(cursor_location.x, cursor_location.y); | 578 ::SetCursorPos(cursor_location.x, cursor_location.y); |
578 } | 579 } |
579 | 580 |
580 //////////////////////////////////////////////////////////////////////////////// | 581 //////////////////////////////////////////////////////////////////////////////// |
581 // DesktopWindowTreeHostWin, aura::AnimationHost implementation: | 582 // DesktopWindowTreeHostWin, aura::AnimationHost implementation: |
582 | 583 |
583 void DesktopWindowTreeHostWin::SetHostTransitionOffsets( | 584 void DesktopWindowTreeHostWin::SetHostTransitionOffsets( |
584 const gfx::Vector2d& top_left_delta, | 585 const gfx::Vector2d& top_left_delta, |
585 const gfx::Vector2d& bottom_right_delta) { | 586 const gfx::Vector2d& bottom_right_delta) { |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 | 994 |
994 // static | 995 // static |
995 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 996 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
996 internal::NativeWidgetDelegate* native_widget_delegate, | 997 internal::NativeWidgetDelegate* native_widget_delegate, |
997 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 998 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
998 return new DesktopWindowTreeHostWin(native_widget_delegate, | 999 return new DesktopWindowTreeHostWin(native_widget_delegate, |
999 desktop_native_widget_aura); | 1000 desktop_native_widget_aura); |
1000 } | 1001 } |
1001 | 1002 |
1002 } // namespace views | 1003 } // namespace views |
OLD | NEW |