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

Side by Side Diff: ash/wm/frame_painter.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 "ash/wm/frame_painter.h" 5 #include "ash/wm/frame_painter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 gfx::Rect FramePainter::GetWindowBoundsForClientBounds( 320 gfx::Rect FramePainter::GetWindowBoundsForClientBounds(
321 int top_height, 321 int top_height,
322 const gfx::Rect& client_bounds) const { 322 const gfx::Rect& client_bounds) const {
323 return gfx::Rect(std::max(0, client_bounds.x() - kBorderThickness), 323 return gfx::Rect(std::max(0, client_bounds.x() - kBorderThickness),
324 std::max(0, client_bounds.y() - top_height), 324 std::max(0, client_bounds.y() - top_height),
325 client_bounds.width() + (2 * kBorderThickness), 325 client_bounds.width() + (2 * kBorderThickness),
326 client_bounds.height() + top_height + kBorderThickness); 326 client_bounds.height() + top_height + kBorderThickness);
327 } 327 }
328 328
329 int FramePainter::NonClientHitTest(views::NonClientFrameView* view, 329 int FramePainter::NonClientHitTest(const views::NonClientFrameView* view,
330 const gfx::Point& point) { 330 const gfx::Point& point) const {
331 gfx::Rect expanded_bounds = view->bounds(); 331 gfx::Rect expanded_bounds = view->bounds();
332 int outside_bounds = kResizeOutsideBoundsSize; 332 int outside_bounds = kResizeOutsideBoundsSize;
333 333
334 if (aura::Env::GetInstance()->is_touch_down()) 334 if (aura::Env::GetInstance()->is_touch_down())
335 outside_bounds *= kResizeOutsideBoundsScaleForTouch; 335 outside_bounds *= kResizeOutsideBoundsScaleForTouch;
336 expanded_bounds.Inset(-outside_bounds, -outside_bounds); 336 expanded_bounds.Inset(-outside_bounds, -outside_bounds);
337 337
338 if (!expanded_bounds.Contains(point)) 338 if (!expanded_bounds.Contains(point))
339 return HTNOWHERE; 339 return HTNOWHERE;
340 340
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 // |window_icon_| for this computation as it may be NULL. 953 // |window_icon_| for this computation as it may be NULL.
954 int title_y = GetCloseButtonCenterY() - title_font.GetHeight() / 2; 954 int title_y = GetCloseButtonCenterY() - title_font.GetHeight() / 2;
955 return gfx::Rect( 955 return gfx::Rect(
956 title_x, 956 title_x,
957 std::max(0, title_y), 957 std::max(0, title_y),
958 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x), 958 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x),
959 title_font.GetHeight()); 959 title_font.GetHeight());
960 } 960 }
961 961
962 } // namespace ash 962 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698