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

Side by Side Diff: chrome/browser/gtk/tabs/dragged_tab_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/slide_animator_gtk.cc ('k') | chrome/browser/gtk/tabs/tab_renderer_gtk.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/dragged_tab_gtk.h" 5 #include "chrome/browser/gtk/tabs/dragged_tab_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 gint x, y, width, height; 119 gint x, y, width, height;
120 gdk_window_get_origin(container_->window, &x, &y); 120 gdk_window_get_origin(container_->window, &x, &y);
121 gdk_window_get_geometry(container_->window, NULL, NULL, 121 gdk_window_get_geometry(container_->window, NULL, NULL,
122 &width, &height, NULL); 122 &width, &height, NULL);
123 123
124 animation_start_bounds_ = gfx::Rect(x, y, width, height); 124 animation_start_bounds_ = gfx::Rect(x, y, width, height);
125 animation_end_bounds_ = bounds; 125 animation_end_bounds_ = bounds;
126 126
127 close_animation_.SetSlideDuration(kAnimateToBoundsDurationMs); 127 close_animation_.SetSlideDuration(kAnimateToBoundsDurationMs);
128 close_animation_.SetTweenType(SlideAnimation::EASE_OUT); 128 close_animation_.SetTweenType(Tween::EASE_OUT);
129 if (!close_animation_.IsShowing()) { 129 if (!close_animation_.IsShowing()) {
130 close_animation_.Reset(); 130 close_animation_.Reset();
131 close_animation_.Show(); 131 close_animation_.Show();
132 } 132 }
133 } 133 }
134 134
135 //////////////////////////////////////////////////////////////////////////////// 135 ////////////////////////////////////////////////////////////////////////////////
136 // DraggedTabGtk, AnimationDelegate implementation: 136 // DraggedTabGtk, AnimationDelegate implementation:
137 137
138 void DraggedTabGtk::AnimationProgressed(const Animation* animation) { 138 void DraggedTabGtk::AnimationProgressed(const Animation* animation) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 cairo_set_source_surface(cr, surface, 0, 0); 327 cairo_set_source_surface(cr, surface, 0, 0);
328 cairo_paint(cr); 328 cairo_paint(cr);
329 329
330 cairo_destroy(cr); 330 cairo_destroy(cr);
331 331
332 cairo_surface_destroy(surface); 332 cairo_surface_destroy(surface);
333 333
334 // We've already drawn the tab, so don't propagate the expose-event signal. 334 // We've already drawn the tab, so don't propagate the expose-event signal.
335 return TRUE; 335 return TRUE;
336 } 336 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/slide_animator_gtk.cc ('k') | chrome/browser/gtk/tabs/tab_renderer_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698