summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/bookmark_bar_view.h
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 23:40:15 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 23:40:15 +0000
commit447a51cad97fe5413535c28dae5265ee1ad3c9cc (patch)
treea0914e5f83908a2290f7bae3d7c1f280682627ec /chrome/browser/views/bookmark_bar_view.h
parentfec7dc520f31a2234bffe060a33c4356fe4a5d4c (diff)
downloadchromium_src-447a51cad97fe5413535c28dae5265ee1ad3c9cc.zip
chromium_src-447a51cad97fe5413535c28dae5265ee1ad3c9cc.tar.gz
chromium_src-447a51cad97fe5413535c28dae5265ee1ad3c9cc.tar.bz2
ExtensionShelf now uses the BookmarkExtensionBackground, just like the BookmarkBarView.
Changed the WebKit API to add an optional |id| parameter to the insertStyleText, which is needed to be able to replace style sheets that have been previously added. Added an interface that both BookmarkBarView and ExtensionShelf implement. This new interface tells us whether we are located at the top or at the bottom and whether we are detached from the frame or not. Factored out some of the duplicate painting-related code to a namespace of its own. Not happy with the name (welcome suggestions). Moved the check for whether extensions are on top to new class and now cache the value for the lifetime of the process. Toolstrip text color values are no longer hard-coded but use the color specified in the theme. Decreased the timeouts for showing and hiding the toolstrip handle. Replaced the pressed background image and the hover background image for the toolstrip to match what the bookmark bar uses. Known issues: Some themes expose the fact that: - The background for the extension shelf when in detached mode (and located on the bottom) does not seamlessly blend in with background of new tab page. Still works surprisingly well when it breaks, though. - Didn't spend much time theming the shelf handle (just used the solid color from the theme). BUG=18452, 21272, 21273 TEST=Install a theme for Chrome and make sure everything looks correct and is updated on a theme change. Also make sure painting problems in bugs 21272 and 21273 are fixed. Review URL: http://codereview.chromium.org/203034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26178 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_bar_view.h')
-rw-r--r--chrome/browser/views/bookmark_bar_view.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h
index 06b44f2..20fcc07 100644
--- a/chrome/browser/views/bookmark_bar_view.h
+++ b/chrome/browser/views/bookmark_bar_view.h
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/views/bookmark_menu_controller_views.h"
+#include "chrome/browser/views/detachable_toolbar_view.h"
#include "chrome/common/notification_registrar.h"
#include "views/controls/button/menu_button.h"
#include "views/controls/label.h"
@@ -33,7 +34,7 @@ class MenuItemView;
// BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView
// waits until the HistoryService for the profile has been loaded before
// creating the BookmarkModel.
-class BookmarkBarView : public views::View,
+class BookmarkBarView : public DetachableToolbarView,
#ifdef CHROME_PERSONALIZATION
public ProfileSyncServiceObserver,
#endif
@@ -88,6 +89,13 @@ class BookmarkBarView : public views::View,
// the bookmark bar.
void SetPageNavigator(PageNavigator* navigator);
+ // DetachableToolbarView methods:
+ virtual bool IsDetached() const;
+ virtual bool IsOnTop() const;
+ virtual double GetAnimationValue() const {
+ return size_animation_->GetCurrentValue();
+ }
+
// View methods:
virtual gfx::Size GetPreferredSize();
virtual gfx::Size GetMinimumSize();
@@ -108,9 +116,6 @@ class BookmarkBarView : public views::View,
virtual bool GetAccessibleName(std::wstring* name);
virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
virtual void SetAccessibleName(const std::wstring& name);
- double GetSizeAnimationValue() const {
- return size_animation_->GetCurrentValue();
- }
#ifdef CHROME_PERSONALIZATION
// ProfileSyncServiceObserver method.
@@ -143,15 +148,11 @@ class BookmarkBarView : public views::View,
// Returns the model.
BookmarkModel* GetModel() { return model_; }
- // Returns true if the bookmark bar is drawn detached from the toolbar. This
- // can only be true when OnNewTabPage() is true (see below).
- bool IsDetachedStyle();
-
// Returns true if the bookmarks bar preference is set to 'always show'.
- bool IsAlwaysShown();
+ bool IsAlwaysShown() const;
// True if we're on a page where the bookmarks bar is always visible.
- bool OnNewTabPage();
+ bool OnNewTabPage() const;
// How much we want the bookmark bar to overlap the toolbar. If |return_max|
// is true, we return the maximum overlap rather than the current overlap.