Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.mm

Issue 1146873002: [MacViews] Enable dragging a window by its caption/draggable areas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to single repost and [NSWindow setMovableByWindowBackground]. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/frame/browser_non_client_frame_view_mac.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_mac.h"
6 6
7 #include "chrome/browser/themes/theme_properties.h" 7 #include "chrome/browser/themes/theme_properties.h"
8 #include "chrome/browser/ui/views/frame/browser_frame.h" 8 #include "chrome/browser/ui/views/frame/browser_frame.h"
9 #include "chrome/browser/ui/views/frame/browser_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h"
10 #include "chrome/browser/ui/views/frame/browser_view_layout.h" 10 #include "chrome/browser/ui/views/frame/browser_view_layout.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 gfx::Rect BrowserNonClientFrameViewMac::GetBoundsForClientView() const { 62 gfx::Rect BrowserNonClientFrameViewMac::GetBoundsForClientView() const {
63 return bounds(); 63 return bounds();
64 } 64 }
65 65
66 gfx::Rect BrowserNonClientFrameViewMac::GetWindowBoundsForClientBounds( 66 gfx::Rect BrowserNonClientFrameViewMac::GetWindowBoundsForClientBounds(
67 const gfx::Rect& client_bounds) const { 67 const gfx::Rect& client_bounds) const {
68 return client_bounds; 68 return client_bounds;
69 } 69 }
70 70
71 int BrowserNonClientFrameViewMac::NonClientHitTest(const gfx::Point& point) { 71 int BrowserNonClientFrameViewMac::NonClientHitTest(const gfx::Point& point) {
72 return frame()->client_view()->NonClientHitTest(point); 72 int component = frame()->client_view()->NonClientHitTest(point);
tapted 2015/06/03 00:28:37 maybe we need to encode the close/minimize button
jackhou1 2015/06/03 04:04:44 I was thinking we could do our own NSView hit-test
73
74 // BrowserView::NonClientHitTest will return HTNOWHERE for points that hit
75 // the native title bar. On Mac, we need to explicitly return HTCAPTION for
76 // those points.
77 if (component == HTNOWHERE && bounds().Contains(point))
78 return HTCAPTION;
79
80 return component;
73 } 81 }
74 82
75 void BrowserNonClientFrameViewMac::GetWindowMask(const gfx::Size& size, 83 void BrowserNonClientFrameViewMac::GetWindowMask(const gfx::Size& size,
76 gfx::Path* window_mask) { 84 gfx::Path* window_mask) {
77 } 85 }
78 86
79 void BrowserNonClientFrameViewMac::ResetWindowControls() { 87 void BrowserNonClientFrameViewMac::ResetWindowControls() {
80 } 88 }
81 89
82 void BrowserNonClientFrameViewMac::UpdateWindowIcon() { 90 void BrowserNonClientFrameViewMac::UpdateWindowIcon() {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 166
159 // Draw the tabstrip/toolbar separator. 167 // Draw the tabstrip/toolbar separator.
160 canvas->TileImageInt(*border, 0, 0, x, y, w, border->height()); 168 canvas->TileImageInt(*border, 0, 0, x, y, w, border->height());
161 169
162 // Draw the content/toolbar separator. 170 // Draw the content/toolbar separator.
163 canvas->FillRect( 171 canvas->FillRect(
164 gfx::Rect(x, y + h - kClientEdgeThickness, w, kClientEdgeThickness), 172 gfx::Rect(x, y + h - kClientEdgeThickness, w, kClientEdgeThickness),
165 ThemeProperties::GetDefaultColor( 173 ThemeProperties::GetDefaultColor(
166 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); 174 ThemeProperties::COLOR_TOOLBAR_SEPARATOR));
167 } 175 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698