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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_controller.h

Issue 10446090: Changes the tabstrip dragging code to use coordinates from the events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 class BaseTab; 9 class BaseTab;
10 class TabStripSelectionModel; 10 class TabStripSelectionModel;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Returns true if the specified Tab is closeable. 55 // Returns true if the specified Tab is closeable.
56 virtual bool IsTabCloseable(const BaseTab* tab) const = 0; 56 virtual bool IsTabCloseable(const BaseTab* tab) const = 0;
57 57
58 // Potentially starts a drag for the specified Tab. 58 // Potentially starts a drag for the specified Tab.
59 virtual void MaybeStartDrag( 59 virtual void MaybeStartDrag(
60 BaseTab* tab, 60 BaseTab* tab,
61 const views::MouseEvent& event, 61 const views::MouseEvent& event,
62 const TabStripSelectionModel& original_selection) = 0; 62 const TabStripSelectionModel& original_selection) = 0;
63 63
64 // Continues dragging a Tab. 64 // Continues dragging a Tab.
65 virtual void ContinueDrag(const views::MouseEvent& event) = 0; 65 virtual void ContinueDrag(views::View* view, const gfx::Point& location) = 0;
66 66
67 // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way 67 // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way
68 // other than the user releasing the mouse. Returns whether the tab has been 68 // other than the user releasing the mouse. Returns whether the tab has been
69 // destroyed. 69 // destroyed.
70 virtual bool EndDrag(bool canceled) = 0; 70 virtual bool EndDrag(bool canceled) = 0;
71 71
72 // Returns the tab that contains the specified coordinates, in terms of |tab|, 72 // Returns the tab that contains the specified coordinates, in terms of |tab|,
73 // or NULL if there is no tab that contains the specified point. 73 // or NULL if there is no tab that contains the specified point.
74 virtual BaseTab* GetTabAt(BaseTab* tab, 74 virtual BaseTab* GetTabAt(BaseTab* tab,
75 const gfx::Point& tab_in_tab_coordinates) = 0; 75 const gfx::Point& tab_in_tab_coordinates) = 0;
76 76
77 // Informs that an active tab is selected when already active (ie - clicked 77 // Informs that an active tab is selected when already active (ie - clicked
78 // when already active/foreground). 78 // when already active/foreground).
79 virtual void ClickActiveTab(const BaseTab* tab) const = 0; 79 virtual void ClickActiveTab(const BaseTab* tab) const = 0;
80 80
81 // Invoked when a mouse event occurs on |source|. 81 // Invoked when a mouse event occurs on |source|.
82 virtual void OnMouseEventInTab(views::View* source, 82 virtual void OnMouseEventInTab(views::View* source,
83 const views::MouseEvent& event) = 0; 83 const views::MouseEvent& event) = 0;
84 84
85 // Returns true if |tab| needs to be painted. If false is returned the tab is 85 // Returns true if |tab| needs to be painted. If false is returned the tab is
86 // not painted. If true is returned the tab should be painted and |clip| is 86 // not painted. If true is returned the tab should be painted and |clip| is
87 // set to the clip (if |clip| is empty means no clip). 87 // set to the clip (if |clip| is empty means no clip).
88 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) = 0; 88 virtual bool ShouldPaintTab(const BaseTab* tab, gfx::Rect* clip) = 0;
89 89
90 protected: 90 protected:
91 virtual ~TabController() {} 91 virtual ~TabController() {}
92 }; 92 };
93 93
94 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ 94 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/base_tab.cc ('k') | chrome/browser/ui/views/tabs/tab_drag_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698