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/ui/gtk/throbber_gtk.h" | 5 #include "chrome/browser/ui/gtk/throbber_gtk.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 8 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
11 #include "grit/ui_resources_standard.h" | 11 #include "grit/ui_resources.h" |
12 #include "ui/base/animation/tween.h" | 12 #include "ui/base/animation/tween.h" |
13 #include "ui/gfx/image/cairo_cached_surface.h" | 13 #include "ui/gfx/image/cairo_cached_surface.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // The length of a single cycle of the animation in milliseconds. | 17 // The length of a single cycle of the animation in milliseconds. |
18 const int kThrobberDurationMs = 750; | 18 const int kThrobberDurationMs = 750; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void ThrobberGtk::LoadFrames() { | 94 void ThrobberGtk::LoadFrames() { |
95 frames_ = theme_service_->GetImageNamed(IDR_THROBBER); | 95 frames_ = theme_service_->GetImageNamed(IDR_THROBBER); |
96 DCHECK(frames_); | 96 DCHECK(frames_); |
97 const int width = frames_->ToCairo()->Width(); | 97 const int width = frames_->ToCairo()->Width(); |
98 const int height = frames_->ToCairo()->Height(); | 98 const int height = frames_->ToCairo()->Height(); |
99 DCHECK_EQ(0, width % height); | 99 DCHECK_EQ(0, width % height); |
100 num_frames_ = width / height; | 100 num_frames_ = width / height; |
101 | 101 |
102 gtk_widget_set_size_request(widget_.get(), height, height); | 102 gtk_widget_set_size_request(widget_.get(), height, height); |
103 } | 103 } |
OLD | NEW |