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 "chrome/browser/ui/views/panels/panel_frame_view.h" | 5 #include "chrome/browser/ui/views/panels/panel_frame_view.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/ui/panels/panel.h" | 8 #include "chrome/browser/ui/panels/panel.h" |
9 #include "chrome/browser/ui/panels/panel_constants.h" | 9 #include "chrome/browser/ui/panels/panel_constants.h" |
10 #include "chrome/browser/ui/views/panels/panel_view.h" | 10 #include "chrome/browser/ui/views/panels/panel_view.h" |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 return true; | 586 return true; |
587 } | 587 } |
588 return NonClientFrameView::OnMousePressed(event); | 588 return NonClientFrameView::OnMousePressed(event); |
589 } | 589 } |
590 | 590 |
591 bool PanelFrameView::OnMouseDragged(const ui::MouseEvent& event) { | 591 bool PanelFrameView::OnMouseDragged(const ui::MouseEvent& event) { |
592 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 592 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
593 // Converting the mouse location to screen coordinates returns an incorrect | 593 // Converting the mouse location to screen coordinates returns an incorrect |
594 // location while the panel is moving. See crbug.com/353393 for more details. | 594 // location while the panel is moving. See crbug.com/353393 for more details. |
595 // TODO(pkotwicz): Fix conversion to screen coordinates | 595 // TODO(pkotwicz): Fix conversion to screen coordinates |
596 gfx::Screen* screen = gfx::Screen::GetNativeScreen(); | 596 gfx::Screen* screen = gfx::Screen::GetScreen(); |
597 gfx::Point mouse_location = screen->GetCursorScreenPoint(); | 597 gfx::Point mouse_location = screen->GetCursorScreenPoint(); |
598 #else | 598 #else |
599 // |event.location| is in the view's coordinate system. Convert it to the | 599 // |event.location| is in the view's coordinate system. Convert it to the |
600 // screen coordinate system. | 600 // screen coordinate system. |
601 gfx::Point mouse_location = event.location(); | 601 gfx::Point mouse_location = event.location(); |
602 views::View::ConvertPointToScreen(this, &mouse_location); | 602 views::View::ConvertPointToScreen(this, &mouse_location); |
603 #endif | 603 #endif |
604 | 604 |
605 if (panel_view_->OnTitlebarMouseDragged(mouse_location)) | 605 if (panel_view_->OnTitlebarMouseDragged(mouse_location)) |
606 return true; | 606 return true; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 #endif | 782 #endif |
783 } | 783 } |
784 | 784 |
785 bool PanelFrameView::IsWithinResizingArea( | 785 bool PanelFrameView::IsWithinResizingArea( |
786 const gfx::Point& mouse_location) const { | 786 const gfx::Point& mouse_location) const { |
787 panel::Resizability resizability = panel_view_->panel()->CanResizeByMouse(); | 787 panel::Resizability resizability = panel_view_->panel()->CanResizeByMouse(); |
788 int edge_hittest = GetFrameEdgeHitTest( | 788 int edge_hittest = GetFrameEdgeHitTest( |
789 mouse_location, size(), PanelView::kResizeInsideBoundsSize, resizability); | 789 mouse_location, size(), PanelView::kResizeInsideBoundsSize, resizability); |
790 return edge_hittest != HTNOWHERE; | 790 return edge_hittest != HTNOWHERE; |
791 } | 791 } |
OLD | NEW |