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