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

Side by Side Diff: chrome/browser/ui/gtk/throbber_gtk.h

Issue 9837011: [Web Intents] CWS inline install for GTK (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_GTK_THROBBER_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_THROBBER_GTK_H_
7 #pragma once
8
9 #include <gtk/gtk.h>
10
11 #include "base/compiler_specific.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
14 #include "ui/base/animation/animation_delegate.h"
15 #include "ui/base/animation/slide_animation.h"
16 #include "ui/base/gtk/gtk_signal.h"
17 #include "ui/base/gtk/owned_widget_gtk.h"
18 #include "ui/gfx/image/image.h"
19
20 class SkBitmap;
21 class ThemeServiceGtk;
22
23 // An animating throbber.
24 class ThrobberGtk : public ui::AnimationDelegate,
25 public content::NotificationObserver {
26 public:
27 // |theme_service| must not be NULL.
28 explicit ThrobberGtk(ThemeServiceGtk* theme_service);
29 virtual ~ThrobberGtk();
30
31 // Start or stop the throbbing animation.
32 void Start();
33 void Stop();
34
35 GtkWidget* widget() const { return widget_.get(); }
36
37 // ui::AnimationDelegate implementation.
38 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
39 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
40
41 // content::NotificationObserver implementation.
42 virtual void Observe(int type,
43 const content::NotificationSource& source,
44 const content::NotificationDetails& details) OVERRIDE;
45
46 private:
47 CHROMEGTK_CALLBACK_1(ThrobberGtk, gboolean, OnExpose, GdkEventExpose*);
48
49 // Initialize the widget.
50 void Init();
51
52 // Load the animation frames from IDR_THROBBER.
53 void LoadFrames();
54
55 content::NotificationRegistrar registrar_;
56
57 // The theme service. Weak pointer.
58 ThemeServiceGtk* theme_service_;
59
60 // The actual GtkWidget.
61 ui::OwnedWidgetGtk widget_;
62
63 // A linear animation over the loaded frames.
64 ui::SlideAnimation animation_;
65
66 // The image containing the throbber frames.
67 const gfx::Image* frames_;
68
69 // The number of frames in |frames_|.
70 int num_frames_;
71
72 DISALLOW_COPY_AND_ASSIGN(ThrobberGtk);
73 };
74
75 #endif // CHROME_BROWSER_UI_GTK_THROBBER_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698