OLD | NEW |
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_STRIP_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // MouseWatcherListener overrides: | 191 // MouseWatcherListener overrides: |
192 virtual void MouseMovedOutOfHost() OVERRIDE; | 192 virtual void MouseMovedOutOfHost() OVERRIDE; |
193 | 193 |
194 // views::View overrides: | 194 // views::View overrides: |
195 virtual void Layout() OVERRIDE; | 195 virtual void Layout() OVERRIDE; |
196 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 196 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; |
197 virtual std::string GetClassName() const OVERRIDE; | 197 virtual std::string GetClassName() const OVERRIDE; |
198 virtual gfx::Size GetPreferredSize() OVERRIDE; | 198 virtual gfx::Size GetPreferredSize() OVERRIDE; |
199 // NOTE: the drag and drop methods are invoked from FrameView. This is done | 199 // NOTE: the drag and drop methods are invoked from FrameView. This is done |
200 // to allow for a drop region that extends outside the bounds of the TabStrip. | 200 // to allow for a drop region that extends outside the bounds of the TabStrip. |
201 virtual void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE; | 201 virtual void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE; |
202 virtual int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE; | 202 virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; |
203 virtual void OnDragExited() OVERRIDE; | 203 virtual void OnDragExited() OVERRIDE; |
204 virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE; | 204 virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; |
205 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 205 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
206 virtual views::View* GetEventHandlerForPoint( | 206 virtual views::View* GetEventHandlerForPoint( |
207 const gfx::Point& point) OVERRIDE; | 207 const gfx::Point& point) OVERRIDE; |
208 | 208 |
209 protected: | 209 protected: |
210 // Horizontal gap between mini and non-mini-tabs. | 210 // Horizontal gap between mini and non-mini-tabs. |
211 static const int kMiniToNonMiniGap; | 211 static const int kMiniToNonMiniGap; |
212 | 212 |
213 void set_ideal_bounds(int index, const gfx::Rect& bounds) { | 213 void set_ideal_bounds(int index, const gfx::Rect& bounds) { |
214 tabs_.set_ideal_bounds(index, bounds); | 214 tabs_.set_ideal_bounds(index, bounds); |
215 } | 215 } |
216 | 216 |
217 // Returns the number of mini-tabs. | 217 // Returns the number of mini-tabs. |
218 int GetMiniTabCount() const; | 218 int GetMiniTabCount() const; |
219 | 219 |
220 // views::ButtonListener implementation: | 220 // views::ButtonListener implementation: |
221 virtual void ButtonPressed(views::Button* sender, | 221 virtual void ButtonPressed(views::Button* sender, |
222 const ui::Event& event) OVERRIDE; | 222 const ui::Event& event) OVERRIDE; |
223 | 223 |
224 // View overrides. | 224 // View overrides. |
225 virtual const views::View* GetViewByID(int id) const OVERRIDE; | 225 virtual const views::View* GetViewByID(int id) const OVERRIDE; |
226 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 226 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
227 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 227 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
228 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 228 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
229 virtual void OnMouseCaptureLost() OVERRIDE; | 229 virtual void OnMouseCaptureLost() OVERRIDE; |
230 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 230 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; |
231 virtual ui::GestureStatus OnGestureEvent( | 231 virtual ui::GestureStatus OnGestureEvent( |
232 const views::GestureEvent& event) OVERRIDE; | 232 const ui::GestureEvent& event) OVERRIDE; |
233 | 233 |
234 private: | 234 private: |
235 typedef std::map<int, std::vector<BaseTab*> > TabsClosingMap; | 235 typedef std::map<int, std::vector<BaseTab*> > TabsClosingMap; |
236 | 236 |
237 class RemoveTabDelegate; | 237 class RemoveTabDelegate; |
238 | 238 |
239 friend class TabDragController; | 239 friend class TabDragController; |
240 friend class TabDragControllerTest; | 240 friend class TabDragControllerTest; |
241 | 241 |
242 // Used during a drop session of a url. Tracks the position of the drop as | 242 // Used during a drop session of a url. Tracks the position of the drop as |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 void RemoveMessageLoopObserver(); | 393 void RemoveMessageLoopObserver(); |
394 | 394 |
395 // -- Link Drag & Drop ------------------------------------------------------ | 395 // -- Link Drag & Drop ------------------------------------------------------ |
396 | 396 |
397 // Returns the bounds to render the drop at, in screen coordinates. Sets | 397 // Returns the bounds to render the drop at, in screen coordinates. Sets |
398 // |is_beneath| to indicate whether the arrow is beneath the tab, or above | 398 // |is_beneath| to indicate whether the arrow is beneath the tab, or above |
399 // it. | 399 // it. |
400 gfx::Rect GetDropBounds(int drop_index, bool drop_before, bool* is_beneath); | 400 gfx::Rect GetDropBounds(int drop_index, bool drop_before, bool* is_beneath); |
401 | 401 |
402 // Updates the location of the drop based on the event. | 402 // Updates the location of the drop based on the event. |
403 void UpdateDropIndex(const views::DropTargetEvent& event); | 403 void UpdateDropIndex(const ui::DropTargetEvent& event); |
404 | 404 |
405 // Sets the location of the drop, repainting as necessary. | 405 // Sets the location of the drop, repainting as necessary. |
406 void SetDropIndex(int tab_data_index, bool drop_before); | 406 void SetDropIndex(int tab_data_index, bool drop_before); |
407 | 407 |
408 // Returns the drop effect for dropping a URL on the tab strip. This does | 408 // Returns the drop effect for dropping a URL on the tab strip. This does |
409 // not query the data in anyway, it only looks at the source operations. | 409 // not query the data in anyway, it only looks at the source operations. |
410 int GetDropEffect(const views::DropTargetEvent& event); | 410 int GetDropEffect(const ui::DropTargetEvent& event); |
411 | 411 |
412 // Returns the image to use for indicating a drop on a tab. If is_down is | 412 // Returns the image to use for indicating a drop on a tab. If is_down is |
413 // true, this returns an arrow pointing down. | 413 // true, this returns an arrow pointing down. |
414 static gfx::ImageSkia* GetDropArrowImage(bool is_down); | 414 static gfx::ImageSkia* GetDropArrowImage(bool is_down); |
415 | 415 |
416 // -- Animations ------------------------------------------------------------ | 416 // -- Animations ------------------------------------------------------------ |
417 | 417 |
418 // Returns true if Tabs in this TabStrip are currently changing size or | 418 // Returns true if Tabs in this TabStrip are currently changing size or |
419 // position. | 419 // position. |
420 bool IsAnimating() const; | 420 bool IsAnimating() const; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 // Time of the last mouse move event. | 539 // Time of the last mouse move event. |
540 base::TimeTicks last_mouse_move_time_; | 540 base::TimeTicks last_mouse_move_time_; |
541 | 541 |
542 // Number of mouse moves. | 542 // Number of mouse moves. |
543 int mouse_move_count_; | 543 int mouse_move_count_; |
544 | 544 |
545 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 545 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
546 }; | 546 }; |
547 | 547 |
548 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 548 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
OLD | NEW |