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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "ui/views/masked_targeter_delegate.h" | 23 #include "ui/views/masked_targeter_delegate.h" |
24 #include "ui/views/view.h" | 24 #include "ui/views/view.h" |
25 | 25 |
26 class AlertIndicatorButton; | 26 class AlertIndicatorButton; |
27 class TabController; | 27 class TabController; |
28 | 28 |
29 namespace gfx { | 29 namespace gfx { |
30 class Animation; | 30 class Animation; |
31 class AnimationContainer; | 31 class AnimationContainer; |
32 class LinearAnimation; | 32 class LinearAnimation; |
33 class MultiAnimation; | |
34 class ThrobAnimation; | 33 class ThrobAnimation; |
35 } | 34 } |
36 namespace views { | 35 namespace views { |
37 class ImageButton; | 36 class ImageButton; |
38 class Label; | 37 class Label; |
39 } | 38 } |
40 | 39 |
41 /////////////////////////////////////////////////////////////////////////////// | 40 /////////////////////////////////////////////////////////////////////////////// |
42 // | 41 // |
43 // A View that renders a Tab in a TabStrip. | 42 // A View that renders a Tab in a TabStrip. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void SetData(const TabRendererData& data); | 89 void SetData(const TabRendererData& data); |
91 const TabRendererData& data() const { return data_; } | 90 const TabRendererData& data() const { return data_; } |
92 | 91 |
93 // Sets the network state. | 92 // Sets the network state. |
94 void UpdateLoadingAnimation(TabRendererData::NetworkState state); | 93 void UpdateLoadingAnimation(TabRendererData::NetworkState state); |
95 | 94 |
96 // Starts/Stops a pulse animation. | 95 // Starts/Stops a pulse animation. |
97 void StartPulse(); | 96 void StartPulse(); |
98 void StopPulse(); | 97 void StopPulse(); |
99 | 98 |
100 // Start/stop the pinned tab title animation. | 99 // Sets the visibility of the indicator shown when the tab title changes of |
101 void StartPinnedTabTitleAnimation(); | 100 // an inactive pinned tab. |
102 void StopPinnedTabTitleAnimation(); | 101 void SetPinnedTabTitleChangedIndicatorVisible(bool value); |
103 | 102 |
104 // Set the background offset used to match the image in the inactive tab | 103 // Set the background offset used to match the image in the inactive tab |
105 // to the frame image. | 104 // to the frame image. |
106 void set_background_offset(const gfx::Point& offset) { | 105 void set_background_offset(const gfx::Point& offset) { |
107 background_offset_ = offset; | 106 background_offset_ = offset; |
108 } | 107 } |
109 | 108 |
110 // Returns true if this tab became the active tab selected in | 109 // Returns true if this tab became the active tab selected in |
111 // response to the last ui::ET_TAP_DOWN gesture dispatched to | 110 // response to the last ui::ET_TAP_DOWN gesture dispatched to |
112 // this tab. Only used for collecting UMA metrics. | 111 // this tab. Only used for collecting UMA metrics. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 void DataChanged(const TabRendererData& old); | 238 void DataChanged(const TabRendererData& old); |
240 | 239 |
241 // Paint with the normal tab style. | 240 // Paint with the normal tab style. |
242 void PaintTab(gfx::Canvas* canvas); | 241 void PaintTab(gfx::Canvas* canvas); |
243 | 242 |
244 // Paint with the "immersive mode" light-bar style. | 243 // Paint with the "immersive mode" light-bar style. |
245 void PaintImmersiveTab(gfx::Canvas* canvas); | 244 void PaintImmersiveTab(gfx::Canvas* canvas); |
246 | 245 |
247 // Paint various portions of the Tab. | 246 // Paint various portions of the Tab. |
248 void PaintTabBackground(gfx::Canvas* canvas); | 247 void PaintTabBackground(gfx::Canvas* canvas); |
249 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas); | |
250 void PaintInactiveTabBackground(gfx::Canvas* canvas); | 248 void PaintInactiveTabBackground(gfx::Canvas* canvas); |
251 void PaintTabBackgroundUsingFillId(gfx::Canvas* canvas, | 249 void PaintTabBackgroundUsingFillId(gfx::Canvas* canvas, |
252 bool is_active, | 250 bool is_active, |
253 int fill_id, | 251 int fill_id, |
254 bool has_custom_image, | 252 bool has_custom_image, |
255 int y_offset); | 253 int y_offset); |
256 void PaintTabFill(gfx::Canvas* canvas, | 254 void PaintTabFill(gfx::Canvas* canvas, |
257 gfx::ImageSkia* fill_image, | 255 gfx::ImageSkia* fill_image, |
258 int x_offset, | 256 int x_offset, |
259 int y_offset, | 257 int y_offset, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 336 |
339 // The offset used to animate the favicon location. This is used when the tab | 337 // The offset used to animate the favicon location. This is used when the tab |
340 // crashes. | 338 // crashes. |
341 int favicon_hiding_offset_; | 339 int favicon_hiding_offset_; |
342 | 340 |
343 // Step in the immersive loading progress indicator. | 341 // Step in the immersive loading progress indicator. |
344 int immersive_loading_step_; | 342 int immersive_loading_step_; |
345 | 343 |
346 bool should_display_crashed_favicon_; | 344 bool should_display_crashed_favicon_; |
347 | 345 |
| 346 bool showing_pinned_tab_title_changed_indicator_ = false; |
| 347 |
348 // Whole-tab throbbing "pulse" animation. | 348 // Whole-tab throbbing "pulse" animation. |
349 std::unique_ptr<gfx::ThrobAnimation> pulse_animation_; | 349 std::unique_ptr<gfx::ThrobAnimation> pulse_animation_; |
350 | 350 |
351 std::unique_ptr<gfx::MultiAnimation> pinned_title_change_animation_; | |
352 | |
353 // Crash icon animation (in place of favicon). | 351 // Crash icon animation (in place of favicon). |
354 std::unique_ptr<gfx::LinearAnimation> crash_icon_animation_; | 352 std::unique_ptr<gfx::LinearAnimation> crash_icon_animation_; |
355 | 353 |
356 scoped_refptr<gfx::AnimationContainer> animation_container_; | 354 scoped_refptr<gfx::AnimationContainer> animation_container_; |
357 | 355 |
358 ThrobberView* throbber_; | 356 ThrobberView* throbber_; |
359 AlertIndicatorButton* alert_indicator_button_; | 357 AlertIndicatorButton* alert_indicator_button_; |
360 views::ImageButton* close_button_; | 358 views::ImageButton* close_button_; |
361 views::Label* title_; | 359 views::Label* title_; |
362 | 360 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 SkColor button_color_; | 395 SkColor button_color_; |
398 | 396 |
399 // As the majority of the tabs are inactive, and painting tabs is slowish, | 397 // As the majority of the tabs are inactive, and painting tabs is slowish, |
400 // we cache a handful of the inactive tab backgrounds here. | 398 // we cache a handful of the inactive tab backgrounds here. |
401 static ImageCache* image_cache_; | 399 static ImageCache* image_cache_; |
402 | 400 |
403 DISALLOW_COPY_AND_ASSIGN(Tab); | 401 DISALLOW_COPY_AND_ASSIGN(Tab); |
404 }; | 402 }; |
405 | 403 |
406 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 404 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
OLD | NEW |