summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_titlebar.h
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-31 17:11:41 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-31 17:11:41 +0000
commit6d236bc4b1e2817c1e54ffb3aad567b1bab2d9fb (patch)
treea5bd21f676a5ec1ecc15e6b0e9f653afe62c4b1f /chrome/browser/gtk/browser_titlebar.h
parent028901705d7166ab35d4e01931271511abf9c7da (diff)
downloadchromium_src-6d236bc4b1e2817c1e54ffb3aad567b1bab2d9fb.zip
chromium_src-6d236bc4b1e2817c1e54ffb3aad567b1bab2d9fb.tar.gz
chromium_src-6d236bc4b1e2817c1e54ffb3aad567b1bab2d9fb.tar.bz2
Show an icon and the page title in the custom frame when it's an
app mode window or a popup window. The icon will become a clockwise spinning throbber when pages are loading. BUG=16049 TEST=Open a window using --app=http://google.com/ and click on a few links. Review URL: http://codereview.chromium.org/160427 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.h')
-rw-r--r--chrome/browser/gtk/browser_titlebar.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h
index 4eadcaf..88e17af 100644
--- a/chrome/browser/gtk/browser_titlebar.h
+++ b/chrome/browser/gtk/browser_titlebar.h
@@ -33,12 +33,37 @@ class BrowserTitlebar : public MenuGtk::Delegate {
// tall titlebar and the min/max/close buttons.
void UpdateCustomFrame(bool use_custom_frame);
+ // Updates the title when in app or popup mode (no tabstrip).
+ void UpdateTitle();
+
+ // Called by the browser asking us to update the loading throbber.
+ void UpdateThrobber(bool is_loading);
+
// On Windows, right clicking in the titlebar background brings up the system
// menu. There's no such thing on linux, so we just show the menu items we
// add to the menu.
void ShowContextMenu();
private:
+ // A helper class to keep track of which frame of the throbber animation
+ // we're showing.
+ class Throbber {
+ public:
+ Throbber() : current_frame_(0) {}
+
+ // Get the next frame in the animation. The image is owned by the throbber
+ // so the caller doesn't need to unref.
+ GdkPixbuf* GetNextFrame();
+
+ // Reset back to the first frame.
+ void Reset();
+ private:
+ // Make sure the frames are loaded.
+ static void InitFrames();
+
+ int current_frame_;
+ };
+
// Build the titlebar, the space above the tab
// strip, and (maybe) the min, max, close buttons. |container| is the gtk
// continer that we put the widget into.
@@ -86,6 +111,10 @@ class BrowserTitlebar : public MenuGtk::Delegate {
// manager decorations, we draw this taller.
GtkWidget* titlebar_alignment_;
+ // The favicon and page title used when in app mode or popup mode.
+ GtkWidget* app_mode_favicon_;
+ GtkWidget* app_mode_title_;
+
// Whether we are using a custom frame.
bool using_custom_frame_;
@@ -103,6 +132,9 @@ class BrowserTitlebar : public MenuGtk::Delegate {
// The context menu.
scoped_ptr<MenuGtk> context_menu_;
+
+ // The throbber used when the window is in app mode or popup window mode.
+ Throbber throbber_;
};
#endif // CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_