summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 18:44:31 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-07 18:44:31 +0000
commit7c0560f904487819f2c408c87899d1ccfa91c1fe (patch)
treeda949466cd6dd09f5ce575b206a65b6ba0e1a2f9 /views/widget
parent93a2c7241cddc33af51cdc3daea03e414f544ec8 (diff)
downloadchromium_src-7c0560f904487819f2c408c87899d1ccfa91c1fe.zip
chromium_src-7c0560f904487819f2c408c87899d1ccfa91c1fe.tar.gz
chromium_src-7c0560f904487819f2c408c87899d1ccfa91c1fe.tar.bz2
Basics of a new TabStrip.It's very, very rough, but I wanted to check it in so I don't have to keep typing svn pset as I pass patches back and forth between machines.Behind a command line flag --enable-tabtastic2.I'm trying to split the TabContents specific stuff off of the TabStrip so it's more generic (and more easily mocked for unit testing of various layout conditions). Hence TabStrip vs. BrowserTabStrip. TabStrip may move into views/ once this process is complete.Animator is a utility that can be associated with a View that (at this point) animates that View's bounds from wherever it is now to somewhere else. The TabStrip uses this to do animations for individual Tabs that are independent of each other - a limitation of the old TabStrip is that only one animation is ever active at a time so its animations are a little jumpy compared to other products.Also, detached tab dragging shows the live contents, with all animations/video/etc.Like I said, this is really rough, but I didn't want it to grow any bigger. I will write up a design doc later.http://crbug.com/9032TEST=TBD... will finally be doing some for TabStrip layout!
Review URL: http://codereview.chromium.org/42490 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20053 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/widget.h6
-rw-r--r--views/widget/widget_gtk.cc5
-rw-r--r--views/widget/widget_gtk.h2
-rw-r--r--views/widget/widget_win.cc8
-rw-r--r--views/widget/widget_win.h6
5 files changed, 26 insertions, 1 deletions
diff --git a/views/widget/widget.h b/views/widget/widget.h
index 9c4c5ef..0566b0b 100644
--- a/views/widget/widget.h
+++ b/views/widget/widget.h
@@ -20,6 +20,7 @@ class Accelerator;
class FocusManager;
class RootView;
class TooltipManager;
+class View;
class Window;
////////////////////////////////////////////////////////////////////////////////
@@ -96,6 +97,11 @@ class Widget {
return NULL;
}
+ // Starts a drag operation for the specified view. |point| is a position in
+ // |view| coordinates that the drag was initiated from.
+ virtual void GenerateMousePressedForView(View* view,
+ const gfx::Point& point) = 0;
+
// Returns the accelerator given a command id. Returns false if there is
// no accelerator associated with a given id, which is a common condition.
virtual bool GetAccelerator(int cmd_id,
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 3bec281..c4ea3b5 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -368,6 +368,11 @@ bool WidgetGtk::IsActive() const {
return gtk_window_is_active(GTK_WINDOW(widget_));
}
+void WidgetGtk::GenerateMousePressedForView(View* view,
+ const gfx::Point& point) {
+ NOTIMPLEMENTED();
+}
+
TooltipManager* WidgetGtk::GetTooltipManager() {
return tooltip_manager_.get();
}
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index 58d8895..28cf8be 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -92,6 +92,8 @@ class WidgetGtk : public Widget, public MessageLoopForUI::Observer {
virtual Widget* GetRootWidget() const;
virtual bool IsVisible() const;
virtual bool IsActive() const;
+ virtual void GenerateMousePressedForView(View* view,
+ const gfx::Point& point);
virtual TooltipManager* GetTooltipManager();
virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator);
virtual Window* GetWindow();
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 8d39991..ed58ae9 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -392,6 +392,14 @@ bool WidgetWin::IsActive() const {
return win_util::IsWindowActive(GetNativeView());
}
+void WidgetWin::GenerateMousePressedForView(View* view,
+ const gfx::Point& point) {
+ gfx::Point point_in_widget(point);
+ View::ConvertPointToWidget(view, &point_in_widget);
+ root_view_->SetMouseHandler(view);
+ ProcessMousePressed(point_in_widget.ToPOINT(), MK_LBUTTON, false, false);
+}
+
TooltipManager* WidgetWin::GetTooltipManager() {
return tooltip_manager_.get();
}
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h
index 33c247e..d3665d2 100644
--- a/views/widget/widget_win.h
+++ b/views/widget/widget_win.h
@@ -159,6 +159,7 @@ class WidgetWin : public Widget,
MSG_WM_ENDSESSION(OnEndSession)
MSG_WM_ENTERSIZEMOVE(OnEnterSizeMove)
MSG_WM_EXITMENULOOP(OnExitMenuLoop)
+ MSG_WM_EXITSIZEMOVE(OnExitSizeMove)
MSG_WM_GETMINMAXINFO(OnGetMinMaxInfo)
MSG_WM_HSCROLL(OnHScroll)
MSG_WM_INITMENU(OnInitMenu)
@@ -225,6 +226,8 @@ class WidgetWin : public Widget,
virtual Widget* GetRootWidget() const;
virtual bool IsVisible() const;
virtual bool IsActive() const;
+ virtual void GenerateMousePressedForView(View* view,
+ const gfx::Point& point);
virtual TooltipManager* GetTooltipManager();
virtual ThemeProvider* GetThemeProvider() const;
virtual Window* GetWindow();
@@ -371,10 +374,11 @@ class WidgetWin : public Widget,
}
virtual void OnEndSession(BOOL ending, UINT logoff) { SetMsgHandled(FALSE); }
virtual void OnEnterSizeMove() { SetMsgHandled(FALSE); }
+ virtual LRESULT OnEraseBkgnd(HDC dc);
virtual void OnExitMenuLoop(BOOL is_track_popup_menu) {
SetMsgHandled(FALSE);
}
- virtual LRESULT OnEraseBkgnd(HDC dc);
+ virtual void OnExitSizeMove() { SetMsgHandled(FALSE); }
virtual LRESULT OnGetObject(UINT uMsg, WPARAM w_param, LPARAM l_param);
virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info) {
SetMsgHandled(FALSE);