| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_TABS_BASE_TAB_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_BASE_TAB_H_ |
| 6 #define CHROME_BROWSER_VIEWS_TABS_BASE_TAB_H_ | 6 #define CHROME_BROWSER_VIEWS_TABS_BASE_TAB_H_ |
| 7 | 7 |
| 8 #include "app/animation.h" | 8 #include "app/animation.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 // views::ButtonListener overrides: | 121 // views::ButtonListener overrides: |
| 122 virtual void ButtonPressed(views::Button* sender, | 122 virtual void ButtonPressed(views::Button* sender, |
| 123 const views::Event& event); | 123 const views::Event& event); |
| 124 | 124 |
| 125 // views::ContextMenuController overrides: | 125 // views::ContextMenuController overrides: |
| 126 virtual void ShowContextMenu(views::View* source, | 126 virtual void ShowContextMenu(views::View* source, |
| 127 const gfx::Point& p, | 127 const gfx::Point& p, |
| 128 bool is_mouse_gesture); | 128 bool is_mouse_gesture); |
| 129 | 129 |
| 130 // views::View overrides: | |
| 131 virtual void OnThemeChanged(); | |
| 132 | |
| 133 // Returns the bounds of the title. | 130 // Returns the bounds of the title. |
| 134 virtual const gfx::Rect& title_bounds() const = 0; | 131 virtual const gfx::Rect& title_bounds() const = 0; |
| 135 | 132 |
| 136 // Close button size. | |
| 137 static int close_button_height() { return close_button_height_; } | |
| 138 static int close_button_width() { return close_button_width_; } | |
| 139 | |
| 140 // Size (width/height) of the loading animation. | |
| 141 static int loading_animation_size() { return loading_animation_size_; } | |
| 142 | |
| 143 static gfx::Font* font() { return font_; } | 133 static gfx::Font* font() { return font_; } |
| 144 static int font_height() { return font_height_; } | 134 static int font_height() { return font_height_; } |
| 145 | 135 |
| 146 private: | 136 private: |
| 147 // 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. |
| 148 class FavIconCrashAnimation; | 138 class FavIconCrashAnimation; |
| 149 | 139 |
| 150 // Set the temporary offset for the favicon. This is used during the crash | 140 // Set the temporary offset for the favicon. This is used during the crash |
| 151 // animation. | 141 // animation. |
| 152 void SetFavIconHidingOffset(int offset); | 142 void SetFavIconHidingOffset(int offset); |
| 153 | 143 |
| 154 void DisplayCrashedFavIcon(); | 144 void DisplayCrashedFavIcon(); |
| 155 void ResetCrashedFavIcon(); | 145 void ResetCrashedFavIcon(); |
| 156 | 146 |
| 157 // Starts/Stops the crash animation. | 147 // Starts/Stops the crash animation. |
| 158 void StartCrashAnimation(); | 148 void StartCrashAnimation(); |
| 159 void StopCrashAnimation(); | 149 void StopCrashAnimation(); |
| 160 | 150 |
| 161 // Return true if the crash animation is currently running. | 151 // Return true if the crash animation is currently running. |
| 162 bool IsPerformingCrashAnimation() const; | 152 bool IsPerformingCrashAnimation() const; |
| 163 | 153 |
| 164 static void InitResources(); | 154 static void InitResources(); |
| 165 | 155 |
| 166 // Invoked when the theme changes to reload theme images. | |
| 167 static void LoadThemeImages(); | |
| 168 | |
| 169 // The controller. | 156 // The controller. |
| 170 // WARNING: this is null during detached tab dragging. | 157 // WARNING: this is null during detached tab dragging. |
| 171 TabController* controller_; | 158 TabController* controller_; |
| 172 | 159 |
| 173 TabRendererData data_; | 160 TabRendererData data_; |
| 174 | 161 |
| 175 // True if the tab is being animated closed. | 162 // True if the tab is being animated closed. |
| 176 bool closing_; | 163 bool closing_; |
| 177 | 164 |
| 178 // True if the tab is being dragged. | 165 // True if the tab is being dragged. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 200 bool throbber_disabled_; | 187 bool throbber_disabled_; |
| 201 | 188 |
| 202 ThemeProvider* theme_provider_; | 189 ThemeProvider* theme_provider_; |
| 203 | 190 |
| 204 // The offset used to animate the favicon location. This is used when the tab | 191 // The offset used to animate the favicon location. This is used when the tab |
| 205 // crashes. | 192 // crashes. |
| 206 int fav_icon_hiding_offset_; | 193 int fav_icon_hiding_offset_; |
| 207 | 194 |
| 208 bool should_display_crashed_favicon_; | 195 bool should_display_crashed_favicon_; |
| 209 | 196 |
| 210 // Size of the close button. | |
| 211 static int close_button_width_; | |
| 212 static int close_button_height_; | |
| 213 | |
| 214 // Size of the loading animation frames. | |
| 215 static int loading_animation_size_; | |
| 216 | |
| 217 static gfx::Font* font_; | 197 static gfx::Font* font_; |
| 218 static int font_height_; | 198 static int font_height_; |
| 219 | 199 |
| 220 DISALLOW_COPY_AND_ASSIGN(BaseTab); | 200 DISALLOW_COPY_AND_ASSIGN(BaseTab); |
| 221 }; | 201 }; |
| 222 | 202 |
| 223 #endif // CHROME_BROWSER_VIEWS_TABS_BASE_TAB_H_ | 203 #endif // CHROME_BROWSER_VIEWS_TABS_BASE_TAB_H_ |
| OLD | NEW |