summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_window_gtk.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 22:00:37 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-26 22:00:37 +0000
commitdcb3070302b8ee07a3d1dbfc290a84d325c7a6e3 (patch)
treec4f5942b02cb09f2a37dc96298bbb32d1858d421 /chrome/browser/gtk/browser_window_gtk.h
parenta314ee5ab5322b95a861e38fdc377ec156b0add9 (diff)
downloadchromium_src-dcb3070302b8ee07a3d1dbfc290a84d325c7a6e3.zip
chromium_src-dcb3070302b8ee07a3d1dbfc290a84d325c7a6e3.tar.gz
chromium_src-dcb3070302b8ee07a3d1dbfc290a84d325c7a6e3.tar.bz2
[gtk] spoof proof infobars, take 2
This looks like a big review, but a lot of it is just shuffling code around: - rip out dropshadow code - move arrow state and drawing to a model class, to allow sharing between BrowserWindow and Infobar - get rid of InfoBar's border_bin_ and slightly simplify baseclasses by no longer requiring them to call show() on the toplevel widget Added stuff: - transition between arrow colors (previous_color_ vs. target_color_ business) - arrows protruding on neighboring infobars BUG=48996 TEST=manual, with animations slowed down 100x Review URL: http://codereview.chromium.org/3919004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_window_gtk.h')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h
index ce6fd20..ce8e582 100644
--- a/chrome/browser/gtk/browser_window_gtk.h
+++ b/chrome/browser/gtk/browser_window_gtk.h
@@ -12,12 +12,12 @@
#include "app/active_window_watcher_x.h"
#include "app/gtk_signal.h"
-#include "app/slide_animation.h"
#include "app/x11_util.h"
#include "base/scoped_ptr.h"
#include "base/timer.h"
#include "build/build_config.h"
#include "chrome/browser/browser_window.h"
+#include "chrome/browser/gtk/infobar_arrow_model.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/tabs/tab_strip_model_observer.h"
#include "chrome/common/notification_registrar.h"
@@ -45,7 +45,7 @@ class BrowserWindowGtk : public BrowserWindow,
public NotificationObserver,
public TabStripModelObserver,
public ActiveWindowWatcherX::Observer,
- public AnimationDelegate {
+ public InfoBarArrowModel::Observer {
public:
explicit BrowserWindowGtk(Browser* browser);
virtual ~BrowserWindowGtk();
@@ -145,10 +145,8 @@ class BrowserWindowGtk : public BrowserWindow,
// Overridden from ActiveWindowWatcher::Observer.
virtual void ActiveWindowChanged(GdkWindow* active_window);
- // Overridden from AnimationDelegate.
- virtual void AnimationEnded(const Animation* animation);
- virtual void AnimationProgressed(const Animation* animation);
- virtual void AnimationCanceled(const Animation* animation);
+ // Overridden from InfoBarArrowModel::Observer.
+ virtual void PaintStateChanged();
// Accessor for the tab strip.
TabStripGtk* tabstrip() const { return tabstrip_.get(); }
@@ -178,16 +176,9 @@ class BrowserWindowGtk : public BrowserWindow,
// else for the custom frame.
void ResetCustomFrameCursor();
- // Toggles whether an infobar is showing. If |colors| is NULL, then no infobar
- // is showing. When non-NULL, |colors| describes the gradient stop colors for
- // the showing infobar.
- // |animate| controls whether we animate to the new state set by |colors|.
- void SetInfoBarShowing(const std::pair<SkColor, SkColor>* colors,
- bool animate);
-
- // Called by the RenderViewHostDelegate::View (TabContentsViewGtk in our case)
- // to decide whether to draw a drop shadow on the render view.
- bool ShouldDrawInfobarDropShadowOnRenderView();
+ // Toggles whether an infobar is showing.
+ // |animate| controls whether we animate to the new state set by |bar|.
+ void SetInfoBarShowing(InfoBar* bar, bool animate);
// Returns the BrowserWindowGtk registered with |window|.
static BrowserWindowGtk* GetBrowserWindowForNativeWindow(
@@ -221,6 +212,10 @@ class BrowserWindowGtk : public BrowserWindow,
// redraw when it should.
void QueueToolbarRedraw();
+ // Get the position where the infobar arrow should be anchored in
+ // |relative_to| coordinates. This is the middle of the omnibox location icon.
+ int GetXPositionOfLocationIcon(GtkWidget* relative_to);
+
protected:
virtual void DestroyBrowser();
// Top level window.
@@ -480,11 +475,9 @@ class BrowserWindowGtk : public BrowserWindow,
scoped_ptr<FullscreenExitBubbleGtk> fullscreen_exit_bubble_;
- // The top and bottom colors for the infobar gradient, if there is an
- // infobar showing.
- std::pair<SkColor, SkColor> infobar_colors_;
-
- SlideAnimation infobar_animation_;
+ // The model that tracks the paint state of the arrow for the infobar
+ // directly below the toolbar.
+ InfoBarArrowModel infobar_arrow_model_;
DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk);
};