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

Side by Side Diff: ui/views/window/custom_frame_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/custom_frame_view.h" 5 #include "ui/views/window/custom_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 gfx::Rect CustomFrameView::GetWindowBoundsForClientBounds( 143 gfx::Rect CustomFrameView::GetWindowBoundsForClientBounds(
144 const gfx::Rect& client_bounds) const { 144 const gfx::Rect& client_bounds) const {
145 int top_height = NonClientTopBorderHeight(); 145 int top_height = NonClientTopBorderHeight();
146 int border_thickness = NonClientBorderThickness(); 146 int border_thickness = NonClientBorderThickness();
147 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness), 147 return gfx::Rect(std::max(0, client_bounds.x() - border_thickness),
148 std::max(0, client_bounds.y() - top_height), 148 std::max(0, client_bounds.y() - top_height),
149 client_bounds.width() + (2 * border_thickness), 149 client_bounds.width() + (2 * border_thickness),
150 client_bounds.height() + top_height + border_thickness); 150 client_bounds.height() + top_height + border_thickness);
151 } 151 }
152 152
153 int CustomFrameView::NonClientHitTest(const gfx::Point& point) { 153 int CustomFrameView::NonClientHitTest(const gfx::Point& point) const {
154 // Sanity check. 154 // Sanity check.
155 if (!bounds().Contains(point)) 155 if (!bounds().Contains(point))
156 return HTNOWHERE; 156 return HTNOWHERE;
157 157
158 int frame_component = frame_->client_view()->NonClientHitTest(point); 158 int frame_component = frame_->client_view()->NonClientHitTest(point);
159 159
160 // See if we're in the sysmenu region. (We check the ClientView first to be 160 // See if we're in the sysmenu region. (We check the ClientView first to be
161 // consistent with OpaqueBrowserFrameView; it's not really necessary here.) 161 // consistent with OpaqueBrowserFrameView; it's not really necessary here.)
162 gfx::Rect sysmenu_rect(IconBounds()); 162 gfx::Rect sysmenu_rect(IconBounds());
163 // In maximized mode we extend the rect to the screen corner to take advantage 163 // In maximized mode we extend the rect to the screen corner to take advantage
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 rb.GetImageNamed(normal_image_id).ToImageSkia()); 564 rb.GetImageNamed(normal_image_id).ToImageSkia());
565 button->SetImage(CustomButton::STATE_HOVERED, 565 button->SetImage(CustomButton::STATE_HOVERED,
566 rb.GetImageNamed(hot_image_id).ToImageSkia()); 566 rb.GetImageNamed(hot_image_id).ToImageSkia());
567 button->SetImage(CustomButton::STATE_PRESSED, 567 button->SetImage(CustomButton::STATE_PRESSED,
568 rb.GetImageNamed(pushed_image_id).ToImageSkia()); 568 rb.GetImageNamed(pushed_image_id).ToImageSkia());
569 AddChildView(button); 569 AddChildView(button);
570 return button; 570 return button;
571 } 571 }
572 572
573 } // namespace views 573 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698