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 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" | 13 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" |
14 #include "ui/base/layout.h" | 14 #include "ui/base/layout.h" |
15 #include "ui/gfx/animation/animation_delegate.h" | 15 #include "ui/gfx/animation/animation_delegate.h" |
16 #include "ui/gfx/point.h" | 16 #include "ui/gfx/point.h" |
17 #include "ui/views/context_menu_controller.h" | 17 #include "ui/views/context_menu_controller.h" |
18 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
19 #include "ui/views/controls/glow_hover_controller.h" | 19 #include "ui/views/controls/glow_hover_controller.h" |
20 #include "ui/views/view.h" | 20 #include "ui/views/view.h" |
21 | 21 |
22 class TabController; | 22 class TabController; |
23 | 23 |
24 namespace gfx { | 24 namespace gfx { |
25 class Animation; | 25 class Animation; |
26 class AnimationContainer; | 26 class AnimationContainer; |
27 class LinearAnimation; | 27 class LinearAnimation; |
28 class MultiAnimation; | 28 class MultiAnimation; |
| 29 class ThrobAnimation; |
29 } | 30 } |
30 namespace views { | 31 namespace views { |
31 class ImageButton; | 32 class ImageButton; |
32 class Label; | 33 class Label; |
33 } | 34 } |
34 | 35 |
35 /////////////////////////////////////////////////////////////////////////////// | 36 /////////////////////////////////////////////////////////////////////////////// |
36 // | 37 // |
37 // A View that renders a Tab in a TabStrip. | 38 // A View that renders a Tab in a TabStrip. |
38 // | 39 // |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 void DataChanged(const TabRendererData& old); | 210 void DataChanged(const TabRendererData& old); |
210 | 211 |
211 // Paint with the normal tab style. | 212 // Paint with the normal tab style. |
212 void PaintTab(gfx::Canvas* canvas); | 213 void PaintTab(gfx::Canvas* canvas); |
213 | 214 |
214 // Paint with the "immersive mode" light-bar style. | 215 // Paint with the "immersive mode" light-bar style. |
215 void PaintImmersiveTab(gfx::Canvas* canvas); | 216 void PaintImmersiveTab(gfx::Canvas* canvas); |
216 | 217 |
217 // Paint various portions of the Tab | 218 // Paint various portions of the Tab |
218 void PaintTabBackground(gfx::Canvas* canvas); | 219 void PaintTabBackground(gfx::Canvas* canvas); |
219 void PaintInactiveTabBackgroundWithTitleChange( | 220 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas); |
220 gfx::Canvas* canvas, | |
221 gfx::MultiAnimation* animation); | |
222 void PaintInactiveTabBackground(gfx::Canvas* canvas); | 221 void PaintInactiveTabBackground(gfx::Canvas* canvas); |
223 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, | 222 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, |
224 int tab_id); | 223 int tab_id); |
225 void PaintActiveTabBackground(gfx::Canvas* canvas); | 224 void PaintActiveTabBackground(gfx::Canvas* canvas); |
226 | 225 |
227 // Paints the favicon and media indicator icon, mirrored for RTL if needed. | 226 // Paints the favicon and media indicator icon, mirrored for RTL if needed. |
228 void PaintIcon(gfx::Canvas* canvas); | 227 void PaintIcon(gfx::Canvas* canvas); |
229 void PaintMediaIndicator(gfx::Canvas* canvas); | 228 void PaintMediaIndicator(gfx::Canvas* canvas); |
230 | 229 |
231 // Invoked if data_.network_state changes, or the network_state is not none. | 230 // Invoked if data_.network_state changes, or the network_state is not none. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // The current index of the loading animation. The range varies depending on | 319 // The current index of the loading animation. The range varies depending on |
321 // whether the tab is loading or waiting, see AdvanceLoadingAnimation(). | 320 // whether the tab is loading or waiting, see AdvanceLoadingAnimation(). |
322 int loading_animation_frame_; | 321 int loading_animation_frame_; |
323 | 322 |
324 // Step in the immersive loading progress indicator. | 323 // Step in the immersive loading progress indicator. |
325 int immersive_loading_step_; | 324 int immersive_loading_step_; |
326 | 325 |
327 bool should_display_crashed_favicon_; | 326 bool should_display_crashed_favicon_; |
328 | 327 |
329 // Whole-tab throbbing "pulse" animation. | 328 // Whole-tab throbbing "pulse" animation. |
330 scoped_ptr<gfx::Animation> tab_animation_; | 329 scoped_ptr<gfx::ThrobAnimation> pulse_animation_; |
| 330 |
| 331 scoped_ptr<gfx::MultiAnimation> mini_title_change_animation_; |
331 | 332 |
332 // Crash icon animation (in place of favicon). | 333 // Crash icon animation (in place of favicon). |
333 scoped_ptr<gfx::LinearAnimation> crash_icon_animation_; | 334 scoped_ptr<gfx::LinearAnimation> crash_icon_animation_; |
334 | 335 |
335 // Media indicator fade-in/out animation (i.e., only on show/hide, not a | 336 // Media indicator fade-in/out animation (i.e., only on show/hide, not a |
336 // continuous animation). | 337 // continuous animation). |
337 scoped_ptr<gfx::Animation> media_indicator_animation_; | 338 scoped_ptr<gfx::Animation> media_indicator_animation_; |
338 TabMediaState animating_media_state_; | 339 TabMediaState animating_media_state_; |
339 | 340 |
340 scoped_refptr<gfx::AnimationContainer> animation_container_; | 341 scoped_refptr<gfx::AnimationContainer> animation_container_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 SkColor close_button_color_; | 381 SkColor close_button_color_; |
381 | 382 |
382 // 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, |
383 // we cache a handful of the inactive tab backgrounds here. | 384 // we cache a handful of the inactive tab backgrounds here. |
384 static ImageCache* image_cache_; | 385 static ImageCache* image_cache_; |
385 | 386 |
386 DISALLOW_COPY_AND_ASSIGN(Tab); | 387 DISALLOW_COPY_AND_ASSIGN(Tab); |
387 }; | 388 }; |
388 | 389 |
389 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 390 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
OLD | NEW |