summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/tabs/tab_controller.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-09 07:35:32 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-09 07:35:32 +0000
commit213dac2f0bff9162502fe325b6ebb85a255efcb2 (patch)
tree3640cb1f19976e38677b8632537d2d41f8444d0f /chrome/browser/ui/views/tabs/tab_controller.h
parent6de53d401aa8dc6c7e0a9874c71a95ce88ade50d (diff)
downloadchromium_src-213dac2f0bff9162502fe325b6ebb85a255efcb2.zip
chromium_src-213dac2f0bff9162502fe325b6ebb85a255efcb2.tar.gz
chromium_src-213dac2f0bff9162502fe325b6ebb85a255efcb2.tar.bz2
Move browser/views to browser/ui/views
TBR=brettw BUG=none TEST=none Review URL: http://codereview.chromium.org/4694005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/tabs/tab_controller.h')
-rw-r--r--chrome/browser/ui/views/tabs/tab_controller.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/tabs/tab_controller.h b/chrome/browser/ui/views/tabs/tab_controller.h
new file mode 100644
index 0000000..c876346
--- /dev/null
+++ b/chrome/browser/ui/views/tabs/tab_controller.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
+#define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_
+#pragma once
+
+class BaseTab;
+
+namespace gfx {
+class Point;
+}
+namespace views {
+class MouseEvent;
+}
+
+// Controller for tabs.
+class TabController {
+ public:
+ // Selects the tab.
+ virtual void SelectTab(BaseTab* tab) = 0;
+
+ // Closes the tab.
+ virtual void CloseTab(BaseTab* tab) = 0;
+
+ // Shows a context menu for the tab at the specified point in screen coords.
+ virtual void ShowContextMenu(BaseTab* tab, const gfx::Point& p) = 0;
+
+ // Returns true if the specified Tab is selected.
+ virtual bool IsTabSelected(const BaseTab* tab) const = 0;
+
+ // Returns true if the specified Tab is pinned.
+ virtual bool IsTabPinned(const BaseTab* tab) const = 0;
+
+ // Returns true if the specified Tab is closeable.
+ virtual bool IsTabCloseable(const BaseTab* tab) const = 0;
+
+ // Potentially starts a drag for the specified Tab.
+ virtual void MaybeStartDrag(BaseTab* tab, const views::MouseEvent& event) = 0;
+
+ // Continues dragging a Tab.
+ virtual void ContinueDrag(const views::MouseEvent& event) = 0;
+
+ // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way
+ // other than the user releasing the mouse. Returns whether the tab has been
+ // destroyed.
+ virtual bool EndDrag(bool canceled) = 0;
+
+ // Returns the tab that contains the specified coordinates, in terms of |tab|,
+ // or NULL if there is no tab that contains the specified point.
+ virtual BaseTab* GetTabAt(BaseTab* tab,
+ const gfx::Point& tab_in_tab_coordinates) = 0;
+
+ protected:
+ virtual ~TabController() {}
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_