| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 // Returns the width for mini-tabs. Mini-tabs always have this width. | 124 // Returns the width for mini-tabs. Mini-tabs always have this width. |
| 125 static int GetMiniWidth(); | 125 static int GetMiniWidth(); |
| 126 | 126 |
| 127 // Returns the height for immersive mode tabs. | 127 // Returns the height for immersive mode tabs. |
| 128 static int GetImmersiveHeight(); | 128 static int GetImmersiveHeight(); |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 friend class TabTest; | 131 friend class TabTest; |
| 132 FRIEND_TEST_ALL_PREFIXES(TabTest, CloseButtonLayout); | 132 FRIEND_TEST_ALL_PREFIXES(TabTest, CloseButtonLayout); |
| 133 |
| 134 friend class TabStripTest; |
| 135 FRIEND_TEST_ALL_PREFIXES(TabStripTest, TabHitTestMaskWhenStacked); |
| 136 |
| 133 // The animation object used to swap the favicon with the sad tab icon. | 137 // The animation object used to swap the favicon with the sad tab icon. |
| 134 class FaviconCrashAnimation; | 138 class FaviconCrashAnimation; |
| 135 class TabCloseButton; | 139 class TabCloseButton; |
| 136 | 140 |
| 137 // Contains a cached image and the values used to generate it. | 141 // Contains a cached image and the values used to generate it. |
| 138 struct ImageCacheEntry { | 142 struct ImageCacheEntry { |
| 139 ImageCacheEntry(); | 143 ImageCacheEntry(); |
| 140 ~ImageCacheEntry(); | 144 ~ImageCacheEntry(); |
| 141 | 145 |
| 142 // ID of the resource used. | 146 // ID of the resource used. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 164 virtual void ShowContextMenuForView(views::View* source, | 168 virtual void ShowContextMenuForView(views::View* source, |
| 165 const gfx::Point& point, | 169 const gfx::Point& point, |
| 166 ui::MenuSourceType source_type) OVERRIDE; | 170 ui::MenuSourceType source_type) OVERRIDE; |
| 167 | 171 |
| 168 // Overridden from views::View: | 172 // Overridden from views::View: |
| 169 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 173 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 170 virtual void Layout() OVERRIDE; | 174 virtual void Layout() OVERRIDE; |
| 171 virtual void OnThemeChanged() OVERRIDE; | 175 virtual void OnThemeChanged() OVERRIDE; |
| 172 virtual const char* GetClassName() const OVERRIDE; | 176 virtual const char* GetClassName() const OVERRIDE; |
| 173 virtual bool HasHitTestMask() const OVERRIDE; | 177 virtual bool HasHitTestMask() const OVERRIDE; |
| 174 virtual void GetHitTestMask(gfx::Path* path) const OVERRIDE; | 178 virtual void GetHitTestMask(HitTestSource source, |
| 179 gfx::Path* path) const OVERRIDE; |
| 175 virtual bool GetTooltipText(const gfx::Point& p, | 180 virtual bool GetTooltipText(const gfx::Point& p, |
| 176 string16* tooltip) const OVERRIDE; | 181 string16* tooltip) const OVERRIDE; |
| 177 virtual bool GetTooltipTextOrigin(const gfx::Point& p, | 182 virtual bool GetTooltipTextOrigin(const gfx::Point& p, |
| 178 gfx::Point* origin) const OVERRIDE; | 183 gfx::Point* origin) const OVERRIDE; |
| 179 virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE; | 184 virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE; |
| 180 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 185 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 181 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 186 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
| 182 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 187 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 183 virtual void OnMouseCaptureLost() OVERRIDE; | 188 virtual void OnMouseCaptureLost() OVERRIDE; |
| 184 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 189 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 static int font_height_; | 381 static int font_height_; |
| 377 | 382 |
| 378 // As the majority of the tabs are inactive, and painting tabs is slowish, | 383 // As the majority of the tabs are inactive, and painting tabs is slowish, |
| 379 // we cache a handful of the inactive tab backgrounds here. | 384 // we cache a handful of the inactive tab backgrounds here. |
| 380 static ImageCache* image_cache_; | 385 static ImageCache* image_cache_; |
| 381 | 386 |
| 382 DISALLOW_COPY_AND_ASSIGN(Tab); | 387 DISALLOW_COPY_AND_ASSIGN(Tab); |
| 383 }; | 388 }; |
| 384 | 389 |
| 385 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 390 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
| OLD | NEW |