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 "chrome/browser/ui/panels/panel.h" | 7 #include "chrome/browser/ui/panels/panel.h" |
8 #include "chrome/browser/ui/panels/panel_constants.h" | 8 #include "chrome/browser/ui/panels/panel_constants.h" |
9 #include "chrome/browser/ui/views/panels/panel_view.h" | 9 #include "chrome/browser/ui/views/panels/panel_view.h" |
10 #include "chrome/browser/ui/views/tab_icon_view.h" | 10 #include "chrome/browser/ui/views/tab_icon_view.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 344 } |
345 | 345 |
346 void PanelFrameView::SetWindowCornerStyle(panel::CornerStyle corner_style) { | 346 void PanelFrameView::SetWindowCornerStyle(panel::CornerStyle corner_style) { |
347 corner_style_ = corner_style; | 347 corner_style_ = corner_style; |
348 | 348 |
349 #if defined(OS_WIN) | 349 #if defined(OS_WIN) |
350 // Changing the window region is going to force a paint. Only change the | 350 // Changing the window region is going to force a paint. Only change the |
351 // window region if the region really differs. | 351 // window region if the region really differs. |
352 HWND native_window = views::HWNDForWidget(panel_view_->window()); | 352 HWND native_window = views::HWNDForWidget(panel_view_->window()); |
353 base::win::ScopedRegion current_region(::CreateRectRgn(0, 0, 0, 0)); | 353 base::win::ScopedRegion current_region(::CreateRectRgn(0, 0, 0, 0)); |
354 int current_region_result = ::GetWindowRgn(native_window, current_region); | 354 ::GetWindowRgn(native_window, current_region); |
355 | 355 |
356 gfx::Path window_mask; | 356 gfx::Path window_mask; |
357 GetWindowMask(size(), &window_mask); | 357 GetWindowMask(size(), &window_mask); |
358 base::win::ScopedRegion new_region; | 358 base::win::ScopedRegion new_region; |
359 if (!window_mask.isEmpty()) | 359 if (!window_mask.isEmpty()) |
360 new_region.Set(gfx::CreateHRGNFromSkPath(window_mask)); | 360 new_region.Set(gfx::CreateHRGNFromSkPath(window_mask)); |
361 | 361 |
362 const bool has_current_region = current_region != NULL; | 362 const bool has_current_region = current_region != NULL; |
363 const bool has_new_region = new_region != NULL; | 363 const bool has_new_region = new_region != NULL; |
364 if (has_current_region != has_new_region || | 364 if (has_current_region != has_new_region || |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 #endif | 774 #endif |
775 } | 775 } |
776 | 776 |
777 bool PanelFrameView::IsWithinResizingArea( | 777 bool PanelFrameView::IsWithinResizingArea( |
778 const gfx::Point& mouse_location) const { | 778 const gfx::Point& mouse_location) const { |
779 panel::Resizability resizability = panel_view_->panel()->CanResizeByMouse(); | 779 panel::Resizability resizability = panel_view_->panel()->CanResizeByMouse(); |
780 int edge_hittest = GetFrameEdgeHitTest( | 780 int edge_hittest = GetFrameEdgeHitTest( |
781 mouse_location, size(), PanelView::kResizeInsideBoundsSize, resizability); | 781 mouse_location, size(), PanelView::kResizeInsideBoundsSize, resizability); |
782 return edge_hittest != HTNOWHERE; | 782 return edge_hittest != HTNOWHERE; |
783 } | 783 } |
OLD | NEW |