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

Unified Diff: chrome/browser/views/tabs/tab_strip.h

Issue 155242: Add temporary TabStripWrapper interface that is implemented by both TabStrip ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/tabs/dragged_tab_controller.cc ('k') | chrome/browser/views/tabs/tab_strip.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab_strip.h
===================================================================
--- chrome/browser/views/tabs/tab_strip.h (revision 20183)
+++ chrome/browser/views/tabs/tab_strip.h (working copy)
@@ -9,6 +9,7 @@
#include "base/message_loop.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/views/tabs/tab.h"
+#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
#include "views/controls/button/image_button.h"
#include "views/view.h"
#if defined(OS_WIN)
@@ -40,40 +41,20 @@
public TabStripModelObserver,
public Tab::TabDelegate,
public views::ButtonListener,
- public MessageLoopForUI::Observer {
+ public MessageLoopForUI::Observer,
+ public TabStripWrapper {
public:
TabStrip(TabStripModel* model);
virtual ~TabStrip();
- // Returns the preferred height of this TabStrip. This is based on the
- // typical height of its constituent tabs.
- int GetPreferredHeight();
-
// Returns true if the TabStrip can accept input events. This returns false
// when the TabStrip is animating to a new state and as such the user should
// not be allowed to interact with the TabStrip.
bool CanProcessInputEvents() const;
- // Returns true if the specified point (in TabStrip coordinates) is within a
- // portion of the TabStrip that should be treated as the containing Window's
- // titlebar for dragging purposes.
- // TODO(beng): (Cleanup) should be const, but GetViewForPoint isn't, so fie!
- bool PointIsWithinWindowCaption(const gfx::Point& point);
-
- // Return true if this tab strip is compatible with the provided tab strip.
- // Compatible tab strips can transfer tabs during drag and drop.
- bool IsCompatibleWith(TabStrip* other);
-
- // Returns true if Tabs in this TabStrip are currently changing size or
- // position.
- bool IsAnimating() const;
-
// Accessors for the model and individual Tabs.
TabStripModel* model() { return model_; }
- // Returns true if there is an active drag session.
- bool IsDragSessionActive() const { return drag_controller_.get() != NULL; }
-
// Destroys the active drag controller.
void DestroyDragController();
@@ -83,12 +64,6 @@
// Retrieve the ideal bounds for the Tab at the specified index.
gfx::Rect GetIdealBounds(int index);
- // Updates loading animations for the TabStrip.
- void UpdateLoadingAnimations();
-
- // Set the background offset used by inactive tabs to match the frame image.
- void SetBackgroundOffset(gfx::Point offset);
-
// Create the new tab button.
void InitTabStripButtons();
@@ -108,8 +83,11 @@
virtual void SetAccessibleName(const std::wstring& name);
virtual views::View* GetViewForPoint(const gfx::Point& point);
virtual void ThemeChanged();
-
protected:
+ virtual void ViewHierarchyChanged(bool is_add,
+ views::View* parent,
+ views::View* child);
+
// TabStripModelObserver implementation:
virtual void TabInsertedAt(TabContents* contents,
int index,
@@ -153,6 +131,20 @@
virtual void DidProcessEvent(GdkEvent* event);
#endif
+ // TabStripWrapper implementation:
+ virtual int GetPreferredHeight();
+ virtual bool IsAnimating() const;
+ virtual void SetBackgroundOffset(gfx::Point offset);
+ virtual bool PointIsWithinWindowCaption(const gfx::Point& point);
+ virtual bool IsDragSessionActive() const;
+ virtual bool IsCompatibleWith(TabStripWrapper* other) const;
+ virtual void SetDraggedTabBounds(int tab_index,
+ const gfx::Rect& tab_bounds);
+ virtual void UpdateLoadingAnimations();
+ virtual views::View* GetView();
+ virtual BrowserTabStrip* AsBrowserTabStrip();
+ virtual TabStrip* AsTabStrip();
+
private:
class InsertTabAnimation;
class MoveTabAnimation;
« no previous file with comments | « chrome/browser/views/tabs/dragged_tab_controller.cc ('k') | chrome/browser/views/tabs/tab_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698