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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 // it was reverted. | 384 // it was reverted. |
385 void StoppedDraggingTabs(const std::vector<Tab*>& tabs, | 385 void StoppedDraggingTabs(const std::vector<Tab*>& tabs, |
386 const std::vector<int>& initial_positions, | 386 const std::vector<int>& initial_positions, |
387 bool move_only, | 387 bool move_only, |
388 bool completed); | 388 bool completed); |
389 | 389 |
390 // Invoked from StoppedDraggingTabs to cleanup |tab|. If |tab| is known | 390 // Invoked from StoppedDraggingTabs to cleanup |tab|. If |tab| is known |
391 // |is_first_tab| is set to true. | 391 // |is_first_tab| is set to true. |
392 void StoppedDraggingTab(Tab* tab, bool* is_first_tab); | 392 void StoppedDraggingTab(Tab* tab, bool* is_first_tab); |
393 | 393 |
394 // Called when a MIME type request for a dragged file has been completed. | |
395 void OnFindURLMimeTypeCompleted(GURL url, const std::string& mime_type); | |
396 | |
394 // Takes ownership of |controller|. | 397 // Takes ownership of |controller|. |
395 void OwnDragController(TabDragController* controller); | 398 void OwnDragController(TabDragController* controller); |
396 | 399 |
397 // Destroys the current TabDragController. This cancel the existing drag | 400 // Destroys the current TabDragController. This cancel the existing drag |
398 // operation. | 401 // operation. |
399 void DestroyDragController(); | 402 void DestroyDragController(); |
400 | 403 |
401 // Releases ownership of the current TabDragController. | 404 // Releases ownership of the current TabDragController. |
402 TabDragController* ReleaseDragController(); | 405 TabDragController* ReleaseDragController(); |
403 | 406 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
572 // cursor. | 575 // cursor. |
573 int available_width_for_tabs_; | 576 int available_width_for_tabs_; |
574 | 577 |
575 // True if PrepareForCloseAt has been invoked. When true remove animations | 578 // True if PrepareForCloseAt has been invoked. When true remove animations |
576 // preserve current tab bounds. | 579 // preserve current tab bounds. |
577 bool in_tab_close_; | 580 bool in_tab_close_; |
578 | 581 |
579 // Valid for the lifetime of a drag over us. | 582 // Valid for the lifetime of a drag over us. |
580 scoped_ptr<DropInfo> drop_info_; | 583 scoped_ptr<DropInfo> drop_info_; |
581 | 584 |
585 // The URL from the latest DropTargetEvent. | |
sky
2013/11/15 00:48:54
All of this state, including the weak factory, sho
michaelpg
2013/11/18 23:24:51
I've moved the URL and supported boolean into Drop
| |
586 GURL drag_url_; | |
587 | |
588 // Whether the MIME type of the file pointed to by drag_url_ is supported. | |
589 // Defaults to true. | |
590 bool drag_file_supported_; | |
591 | |
582 // To ensure all tabs pulse at the same time they share the same animation | 592 // To ensure all tabs pulse at the same time they share the same animation |
583 // container. This is that animation container. | 593 // container. This is that animation container. |
584 scoped_refptr<gfx::AnimationContainer> animation_container_; | 594 scoped_refptr<gfx::AnimationContainer> animation_container_; |
585 | 595 |
586 // MouseWatcher is used for two things: | 596 // MouseWatcher is used for two things: |
587 // . When a tab is closed to reset the layout. | 597 // . When a tab is closed to reset the layout. |
588 // . When a mouse is used and the layout dynamically adjusts and is currently | 598 // . When a mouse is used and the layout dynamically adjusts and is currently |
589 // TAB_STRIP_LAYOUT_STACKED. | 599 // TAB_STRIP_LAYOUT_STACKED. |
590 scoped_ptr<views::MouseWatcher> mouse_watcher_; | 600 scoped_ptr<views::MouseWatcher> mouse_watcher_; |
591 | 601 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
623 // tab close comes from a touch device. | 633 // tab close comes from a touch device. |
624 base::OneShotTimer<TabStrip> resize_layout_timer_; | 634 base::OneShotTimer<TabStrip> resize_layout_timer_; |
625 | 635 |
626 // True if tabs are painted as rectangular light-bars. | 636 // True if tabs are painted as rectangular light-bars. |
627 bool immersive_style_; | 637 bool immersive_style_; |
628 | 638 |
629 // Our observers. | 639 // Our observers. |
630 typedef ObserverList<TabStripObserver> TabStripObservers; | 640 typedef ObserverList<TabStripObserver> TabStripObservers; |
631 TabStripObservers observers_; | 641 TabStripObservers observers_; |
632 | 642 |
643 base::WeakPtrFactory<TabStrip> weak_ptr_factory_; | |
644 | |
633 DISALLOW_COPY_AND_ASSIGN(TabStrip); | 645 DISALLOW_COPY_AND_ASSIGN(TabStrip); |
634 }; | 646 }; |
635 | 647 |
636 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ | 648 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_ |
OLD | NEW |