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

Side by Side Diff: chrome/browser/views/tabs/tab_overview_container.cc

Issue 126185: Improved tab overview animations with better animation and wiring to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/tabs/tab_overview_container.h" 5 #include "chrome/browser/views/tabs/tab_overview_container.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "app/gfx/canvas.h" 9 #include "app/gfx/canvas.h"
10 #include "app/gfx/path.h" 10 #include "app/gfx/path.h"
(...skipping 16 matching lines...) Expand all
27 27
28 TabOverviewContainer::~TabOverviewContainer() { 28 TabOverviewContainer::~TabOverviewContainer() {
29 } 29 }
30 30
31 void TabOverviewContainer::SetMaxSize(const gfx::Size& max_size) { 31 void TabOverviewContainer::SetMaxSize(const gfx::Size& max_size) {
32 GetTabOverviewGrid()->set_max_size( 32 GetTabOverviewGrid()->set_max_size(
33 gfx::Size(max_size.width() - kHorizontalPadding * 2, 33 gfx::Size(max_size.width() - kHorizontalPadding * 2,
34 max_size.height() - kVerticalPadding * 2 - kArrowHeight)); 34 max_size.height() - kVerticalPadding * 2 - kArrowHeight));
35 } 35 }
36 36
37 void TabOverviewContainer::UpdateWidgetShape(int width, int height) { 37 void TabOverviewContainer::UpdateWidgetShape(int horizontal_center,
38 int width, int height) {
38 int bottom_y = height - kArrowHeight; 39 int bottom_y = height - kArrowHeight;
39 int right_edge = width - 1; 40 int right_edge = width - 1;
40 int center = width / 2; 41 int center = width / 2;
41 // The points in alternating x,y pairs. 42 // The points, in alternating x,y pairs.
42 int points[] = { 43 int points[] = {
43 kEdgeInset, 0, 44 kEdgeInset, 0,
44 right_edge - kEdgeInset, 0, 45 right_edge - kEdgeInset, 0,
45 right_edge, kEdgeInset, 46 right_edge, kEdgeInset,
46 right_edge, bottom_y - kEdgeInset - 1, 47 right_edge, bottom_y - kEdgeInset - 1,
47 right_edge - kEdgeInset, bottom_y - 1, 48 right_edge - kEdgeInset, bottom_y - 1,
48 center + kArrowHeight / 2, bottom_y - 1, 49 center + kArrowHeight / 2, bottom_y - 1,
49 center, bottom_y - 1 + kArrowHeight, 50 center, bottom_y - 1 + kArrowHeight,
50 center - kArrowHeight / 2, bottom_y - 1, 51 center - kArrowHeight / 2, bottom_y - 1,
51 kEdgeInset, bottom_y - 1, 52 kEdgeInset, bottom_y - 1,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 91 }
91 92
92 void TabOverviewContainer::DidChangeBounds(const gfx::Rect& previous, 93 void TabOverviewContainer::DidChangeBounds(const gfx::Rect& previous,
93 const gfx::Rect& current) { 94 const gfx::Rect& current) {
94 Layout(); 95 Layout();
95 } 96 }
96 97
97 TabOverviewGrid* TabOverviewContainer::GetTabOverviewGrid() { 98 TabOverviewGrid* TabOverviewContainer::GetTabOverviewGrid() {
98 return static_cast<TabOverviewGrid*>(GetChildViewAt(0)); 99 return static_cast<TabOverviewGrid*>(GetChildViewAt(0));
99 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698