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

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,
James Hawkins 2012/03/30 21:35:02 This hasn't existed previously?
binji 2012/03/30 23:03:51 Not as a standalone widget, AFAICT.
25 public content::NotificationObserver {
26 public:
27 explicit ThrobberGtk(ThemeServiceGtk* theme_service);
James Hawkins 2012/03/30 21:35:02 nit: Document |theme_service|. Probably must not
binji 2012/03/30 23:03:51 Done.
28 virtual ~ThrobberGtk();
29
30 // Start or stop the throbbing animation.
31 void Start();
32 void Stop();
33
34 GtkWidget* widget() const { return widget_.get(); }
35
36 // ui::AnimationDelegate implementation.
37 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
38 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
39
40 // content::NotificationObserver implementation.
41 virtual void Observe(int type,
42 const content::NotificationSource& source,
43 const content::NotificationDetails& details) OVERRIDE;
44
45 private:
46 CHROMEGTK_CALLBACK_1(ThrobberGtk, gboolean, OnExpose, GdkEventExpose*);
47
48 // Initialize the widget.
49 void Init();
50
51 // Load the animation frames from IDR_THROBBER.
52 void LoadFrames();
53
54 content::NotificationRegistrar registrar_;
55
56 // The theme service.
James Hawkins 2012/03/30 21:35:02 Document ownership (probably weak pointer).
binji 2012/03/30 23:03:51 Done.
57 ThemeServiceGtk* theme_service_;
58
59 // The actual GtkWidget.
60 ui::OwnedWidgetGtk widget_;
61
62 // A linear animation over the loaded frames.
63 ui::SlideAnimation animation_;
Evan Stade 2012/03/30 21:38:25 ThrobAnimation?
binji 2012/03/30 23:03:51 Tried that first, seems like it autoreverses.
Evan Stade 2012/03/31 01:24:35 in what way? it goes counter clockwise?
binji 2012/04/02 18:22:36 Yes. As I understand it, the ThrobAnimation is use
64
65 // The image containing the throbber frames.
66 const gfx::Image* frames_;
67
68 // The number of frames in |frames_|.
69 int num_frames_;
70
71 DISALLOW_COPY_AND_ASSIGN(ThrobberGtk);
72 };
73
74 #endif // CHROME_BROWSER_UI_GTK_THROBBER_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698