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

Side by Side Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 1961001: Refactors animation to allow for cleaner subclassing. I'm doing this (Closed)
Patch Set: Incorporated review feedback Created 10 years, 7 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
« no previous file with comments | « chrome/browser/gtk/tabs/tab_renderer_gtk.cc ('k') | chrome/browser/gtk/translate_infobars.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/gtk/tabs/tab_strip_gtk.h" 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/gtk_dnd_util.h" 9 #include "app/gtk_dnd_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 end_unselected_width_(0), 123 end_unselected_width_(0),
124 layout_on_completion_(false), 124 layout_on_completion_(false),
125 type_(type) { 125 type_(type) {
126 } 126 }
127 virtual ~TabAnimation() {} 127 virtual ~TabAnimation() {}
128 128
129 Type type() const { return type_; } 129 Type type() const { return type_; }
130 130
131 void Start() { 131 void Start() {
132 animation_.SetSlideDuration(GetDuration()); 132 animation_.SetSlideDuration(GetDuration());
133 animation_.SetTweenType(SlideAnimation::EASE_OUT); 133 animation_.SetTweenType(Tween::EASE_OUT);
134 if (!animation_.IsShowing()) { 134 if (!animation_.IsShowing()) {
135 animation_.Reset(); 135 animation_.Reset();
136 animation_.Show(); 136 animation_.Show();
137 } 137 }
138 } 138 }
139 139
140 void Stop() { 140 void Stop() {
141 animation_.Stop(); 141 animation_.Stop();
142 } 142 }
143 143
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 2045
2046 // Let the middle mouse button initiate clicks as well. 2046 // Let the middle mouse button initiate clicks as well.
2047 gtk_util::SetButtonTriggersNavigation(button->widget()); 2047 gtk_util::SetButtonTriggersNavigation(button->widget());
2048 g_signal_connect(button->widget(), "clicked", 2048 g_signal_connect(button->widget(), "clicked",
2049 G_CALLBACK(OnNewTabClicked), this); 2049 G_CALLBACK(OnNewTabClicked), this);
2050 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); 2050 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS);
2051 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); 2051 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0);
2052 2052
2053 return button; 2053 return button;
2054 } 2054 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/tabs/tab_renderer_gtk.cc ('k') | chrome/browser/gtk/translate_infobars.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698