OLD | NEW |
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 "chrome/browser/download/download_started_animation.h" | 5 #include "chrome/browser/download/download_started_animation.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 this, | 166 this, |
167 content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED, | 167 content::NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED, |
168 content::Source<WebContents>(web_contents_)); | 168 content::Source<WebContents>(web_contents_)); |
169 registrar_.Remove( | 169 registrar_.Remove( |
170 this, | 170 this, |
171 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 171 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
172 content::Source<WebContents>(web_contents_)); | 172 content::Source<WebContents>(web_contents_)); |
173 | 173 |
174 web_contents_ = NULL; | 174 web_contents_ = NULL; |
175 gtk_widget_destroy(popup_); | 175 gtk_widget_destroy(popup_); |
176 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 176 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
177 } | 177 } |
178 | 178 |
179 void DownloadStartedAnimationGtk::AnimateToState(double state) { | 179 void DownloadStartedAnimationGtk::AnimateToState(double state) { |
180 if (!web_contents_) | 180 if (!web_contents_) |
181 return; | 181 return; |
182 | 182 |
183 if (state >= 1.0) { | 183 if (state >= 1.0) { |
184 Close(); | 184 Close(); |
185 } else { | 185 } else { |
186 Reposition(); | 186 Reposition(); |
(...skipping 19 matching lines...) Expand all Loading... |
206 Close(); | 206 Close(); |
207 } | 207 } |
208 | 208 |
209 } // namespace | 209 } // namespace |
210 | 210 |
211 // static | 211 // static |
212 void DownloadStartedAnimation::Show(WebContents* web_contents) { | 212 void DownloadStartedAnimation::Show(WebContents* web_contents) { |
213 // The animation will delete itself. | 213 // The animation will delete itself. |
214 new DownloadStartedAnimationGtk(web_contents); | 214 new DownloadStartedAnimationGtk(web_contents); |
215 } | 215 } |
OLD | NEW |