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

Side by Side Diff: ui/views/window/non_client_view.cc

Issue 19115003: Make the maximize button more easily hittable when there is a huge amount of tabs present (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed completely Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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/window/non_client_view.h" 5 #include "ui/views/window/non_client_view.h"
6 6
7 #include "ui/base/accessibility/accessible_view_state.h" 7 #include "ui/base/accessibility/accessible_view_state.h"
8 #include "ui/base/hit_test.h" 8 #include "ui/base/hit_test.h"
9 #include "ui/views/widget/root_view.h" 9 #include "ui/views/widget/root_view.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 void NonClientView::SetInactiveRenderingDisabled(bool disable) { 86 void NonClientView::SetInactiveRenderingDisabled(bool disable) {
87 frame_view_->SetInactiveRenderingDisabled(disable); 87 frame_view_->SetInactiveRenderingDisabled(disable);
88 } 88 }
89 89
90 gfx::Rect NonClientView::GetWindowBoundsForClientBounds( 90 gfx::Rect NonClientView::GetWindowBoundsForClientBounds(
91 const gfx::Rect client_bounds) const { 91 const gfx::Rect client_bounds) const {
92 return frame_view_->GetWindowBoundsForClientBounds(client_bounds); 92 return frame_view_->GetWindowBoundsForClientBounds(client_bounds);
93 } 93 }
94 94
95 int NonClientView::NonClientHitTest(const gfx::Point& point) { 95 int NonClientView::NonClientHitTest(const gfx::Point& point) const {
96 // The NonClientFrameView is responsible for also asking the ClientView. 96 // The NonClientFrameView is responsible for also asking the ClientView.
97 return frame_view_->NonClientHitTest(point); 97 return frame_view_->NonClientHitTest(point);
98 } 98 }
99 99
100 void NonClientView::GetWindowMask(const gfx::Size& size, 100 void NonClientView::GetWindowMask(const gfx::Size& size,
101 gfx::Path* window_mask) { 101 gfx::Path* window_mask) {
102 frame_view_->GetWindowMask(size, window_mask); 102 frame_view_->GetWindowMask(size, window_mask);
103 } 103 }
104 104
105 void NonClientView::ResetWindowControls() { 105 void NonClientView::ResetWindowControls() {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 paint_as_active_ = disable; 236 paint_as_active_ = disable;
237 ShouldPaintAsActiveChanged(); 237 ShouldPaintAsActiveChanged();
238 } 238 }
239 239
240 int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point, 240 int NonClientFrameView::GetHTComponentForFrame(const gfx::Point& point,
241 int top_resize_border_height, 241 int top_resize_border_height,
242 int resize_border_thickness, 242 int resize_border_thickness,
243 int top_resize_corner_height, 243 int top_resize_corner_height,
244 int resize_corner_width, 244 int resize_corner_width,
245 bool can_resize) { 245 bool can_resize) const {
246 // Tricky: In XP, native behavior is to return HTTOPLEFT and HTTOPRIGHT for 246 // Tricky: In XP, native behavior is to return HTTOPLEFT and HTTOPRIGHT for
247 // a |resize_corner_size|-length strip of both the side and top borders, but 247 // a |resize_corner_size|-length strip of both the side and top borders, but
248 // only to return HTBOTTOMLEFT/HTBOTTOMRIGHT along the bottom border + corner 248 // only to return HTBOTTOMLEFT/HTBOTTOMRIGHT along the bottom border + corner
249 // (not the side border). Vista goes further and doesn't return these on any 249 // (not the side border). Vista goes further and doesn't return these on any
250 // of the side borders. We allow callers to match either behavior. 250 // of the side borders. We allow callers to match either behavior.
251 int component; 251 int component;
252 if (point.x() < resize_border_thickness) { 252 if (point.x() < resize_border_thickness) {
253 if (point.y() < top_resize_corner_height) 253 if (point.y() < top_resize_corner_height)
254 component = HTTOPLEFT; 254 component = HTTOPLEFT;
255 else if (point.y() >= (height() - resize_border_thickness)) 255 else if (point.y() >= (height() - resize_border_thickness))
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 const char* NonClientFrameView::GetClassName() const { 313 const char* NonClientFrameView::GetClassName() const {
314 return kViewClassName; 314 return kViewClassName;
315 } 315 }
316 316
317 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 317 void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
318 // Overridden to do nothing. The NonClientView manually calls Layout on the 318 // Overridden to do nothing. The NonClientView manually calls Layout on the
319 // FrameView when it is itself laid out, see comment in NonClientView::Layout. 319 // FrameView when it is itself laid out, see comment in NonClientView::Layout.
320 } 320 }
321 321
322 } // namespace views 322 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698