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

Side by Side Diff: chrome/browser/gtk/slide_animator_gtk.cc

Issue 179028: Revert "Fix a ton of compiler warnings." (Closed)
Patch Set: Created 11 years, 3 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.h ('k') | chrome/browser/gtk/tab_contents_drag_source.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) 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/gtk/slide_animator_gtk.h" 5 #include "chrome/browser/gtk/slide_animator_gtk.h"
6 6
7 #include "app/animation.h" 7 #include "app/animation.h"
8 #include "app/slide_animation.h" 8 #include "app/slide_animation.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 bool SlideAnimatorGtk::IsShowing() { 101 bool SlideAnimatorGtk::IsShowing() {
102 return animation_->IsShowing(); 102 return animation_->IsShowing();
103 } 103 }
104 104
105 bool SlideAnimatorGtk::IsClosing() { 105 bool SlideAnimatorGtk::IsClosing() {
106 return animation_->IsClosing(); 106 return animation_->IsClosing();
107 } 107 }
108 108
109 void SlideAnimatorGtk::AnimationProgressed(const Animation* animation) { 109 void SlideAnimatorGtk::AnimationProgressed(const Animation* animation) {
110 int showing_height = static_cast<int>(child_->allocation.height * 110 int showing_height = child_->allocation.height *
111 animation_->GetCurrentValue()); 111 animation_->GetCurrentValue();
112 if (direction_ == DOWN) { 112 if (direction_ == DOWN) {
113 gtk_fixed_move(GTK_FIXED(widget_.get()), child_, 0, 113 gtk_fixed_move(GTK_FIXED(widget_.get()), child_, 0,
114 showing_height - child_->allocation.height); 114 showing_height - child_->allocation.height);
115 } 115 }
116 gtk_widget_set_size_request(widget_.get(), -1, showing_height); 116 gtk_widget_set_size_request(widget_.get(), -1, showing_height);
117 } 117 }
118 118
119 void SlideAnimatorGtk::AnimationEnded(const Animation* animation) { 119 void SlideAnimatorGtk::AnimationEnded(const Animation* animation) {
120 if (!animation_->IsShowing()) { 120 if (!animation_->IsShowing()) {
121 gtk_widget_hide(widget_.get()); 121 gtk_widget_hide(widget_.get());
122 if (delegate_) 122 if (delegate_)
123 delegate_->Closed(); 123 delegate_->Closed();
124 } 124 }
125 } 125 }
126 126
127 // static 127 // static
128 void SlideAnimatorGtk::OnChildSizeAllocate(GtkWidget* child, 128 void SlideAnimatorGtk::OnChildSizeAllocate(GtkWidget* child,
129 GtkAllocation* allocation, 129 GtkAllocation* allocation,
130 SlideAnimatorGtk* slider) { 130 SlideAnimatorGtk* slider) {
131 if (slider->child_needs_move_) { 131 if (slider->child_needs_move_) {
132 gtk_fixed_move(GTK_FIXED(slider->widget()), child, 0, -allocation->height); 132 gtk_fixed_move(GTK_FIXED(slider->widget()), child, 0, -allocation->height);
133 slider->child_needs_move_ = false; 133 slider->child_needs_move_ = false;
134 } 134 }
135 135
136 if (slider->fixed_needs_resize_) { 136 if (slider->fixed_needs_resize_) {
137 slider->AnimationProgressed(slider->animation_.get()); 137 slider->AnimationProgressed(slider->animation_.get());
138 slider->fixed_needs_resize_ = false; 138 slider->fixed_needs_resize_ = false;
139 } 139 }
140 } 140 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/slide_animator_gtk.h ('k') | chrome/browser/gtk/tab_contents_drag_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698