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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void ActiveStateChanged(); | 82 void ActiveStateChanged(); |
83 | 83 |
84 // Returns true if the tab is selected. | 84 // Returns true if the tab is selected. |
85 bool IsSelected() const; | 85 bool IsSelected() const; |
86 | 86 |
87 // Sets the data this tabs displays. Invokes DataChanged. Should only be | 87 // Sets the data this tabs displays. Invokes DataChanged. Should only be |
88 // called after Tab is added to widget hierarchy. | 88 // called after Tab is added to widget hierarchy. |
89 void SetData(const TabRendererData& data); | 89 void SetData(const TabRendererData& data); |
90 const TabRendererData& data() const { return data_; } | 90 const TabRendererData& data() const { return data_; } |
91 | 91 |
92 // Sets the network state. If the network state changes NetworkStateChanged is | 92 // Sets the network state. |
93 // invoked. | |
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 // Start/stop the pinned tab title animation. |
101 void StartPinnedTabTitleAnimation(); | 100 void StartPinnedTabTitleAnimation(); |
102 void StopPinnedTabTitleAnimation(); | 101 void StopPinnedTabTitleAnimation(); |
103 | 102 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas); | 238 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas); |
240 void PaintInactiveTabBackground(gfx::Canvas* canvas); | 239 void PaintInactiveTabBackground(gfx::Canvas* canvas); |
241 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, | 240 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, |
242 int tab_id); | 241 int tab_id); |
243 void PaintActiveTabBackground(gfx::Canvas* canvas); | 242 void PaintActiveTabBackground(gfx::Canvas* canvas); |
244 | 243 |
245 // Paints the favicon, mirrored for RTL if needed. | 244 // Paints the favicon, mirrored for RTL if needed. |
246 void PaintIcon(gfx::Canvas* canvas); | 245 void PaintIcon(gfx::Canvas* canvas); |
247 | 246 |
248 // Invoked if data_.network_state changes, or the network_state is not none. | 247 // Invoked if data_.network_state changes, or the network_state is not none. |
249 void AdvanceLoadingAnimation(TabRendererData::NetworkState old_state, | 248 void AdvanceLoadingAnimation(TabRendererData::NetworkState state); |
250 TabRendererData::NetworkState state); | |
251 | 249 |
252 // Returns the number of favicon-size elements that can fit in the tab's | 250 // Returns the number of favicon-size elements that can fit in the tab's |
253 // current size. | 251 // current size. |
254 int IconCapacity() const; | 252 int IconCapacity() const; |
255 | 253 |
256 // Returns whether the Tab should display a favicon. | 254 // Returns whether the Tab should display a favicon. |
257 bool ShouldShowIcon() const; | 255 bool ShouldShowIcon() const; |
258 | 256 |
259 // Returns whether the Tab should display the media indicator. | 257 // Returns whether the Tab should display the media indicator. |
260 bool ShouldShowMediaIndicator() const; | 258 bool ShouldShowMediaIndicator() const; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 // True if the tab is being dragged. | 332 // True if the tab is being dragged. |
335 bool dragging_; | 333 bool dragging_; |
336 | 334 |
337 // True if the tab has been detached. | 335 // True if the tab has been detached. |
338 bool detached_; | 336 bool detached_; |
339 | 337 |
340 // The offset used to animate the favicon location. This is used when the tab | 338 // The offset used to animate the favicon location. This is used when the tab |
341 // crashes. | 339 // crashes. |
342 int favicon_hiding_offset_; | 340 int favicon_hiding_offset_; |
343 | 341 |
344 // The point in time when the tab icon was first painted in the waiting state. | |
345 base::TimeTicks waiting_start_time_; | |
346 | |
347 // The point in time when the tab icon was first painted in the loading state. | |
348 base::TimeTicks loading_start_time_; | |
349 | |
350 // Paint state for the throbber after the most recent waiting paint. | |
351 gfx::ThrobberWaitingState waiting_state_; | |
352 | |
353 // Step in the immersive loading progress indicator. | 342 // Step in the immersive loading progress indicator. |
354 int immersive_loading_step_; | 343 int immersive_loading_step_; |
355 | 344 |
356 bool should_display_crashed_favicon_; | 345 bool should_display_crashed_favicon_; |
357 | 346 |
358 // Whole-tab throbbing "pulse" animation. | 347 // Whole-tab throbbing "pulse" animation. |
359 scoped_ptr<gfx::ThrobAnimation> pulse_animation_; | 348 scoped_ptr<gfx::ThrobAnimation> pulse_animation_; |
360 | 349 |
361 scoped_ptr<gfx::MultiAnimation> pinned_title_change_animation_; | 350 scoped_ptr<gfx::MultiAnimation> pinned_title_change_animation_; |
362 | 351 |
363 // Crash icon animation (in place of favicon). | 352 // Crash icon animation (in place of favicon). |
364 scoped_ptr<gfx::LinearAnimation> crash_icon_animation_; | 353 scoped_ptr<gfx::LinearAnimation> crash_icon_animation_; |
365 | 354 |
366 scoped_refptr<gfx::AnimationContainer> animation_container_; | 355 scoped_refptr<gfx::AnimationContainer> animation_container_; |
367 | 356 |
| 357 views::View* throbber_; |
368 MediaIndicatorButton* media_indicator_button_; | 358 MediaIndicatorButton* media_indicator_button_; |
369 views::ImageButton* close_button_; | 359 views::ImageButton* close_button_; |
370 views::Label* title_; | 360 views::Label* title_; |
371 | 361 |
372 bool tab_activated_with_last_tap_down_; | 362 bool tab_activated_with_last_tap_down_; |
373 | 363 |
374 views::GlowHoverController hover_controller_; | 364 views::GlowHoverController hover_controller_; |
375 | 365 |
376 // The bounds of various sections of the display. | 366 // The bounds of various sections of the display. |
377 gfx::Rect favicon_bounds_; | 367 gfx::Rect favicon_bounds_; |
(...skipping 28 matching lines...) Expand all Loading... |
406 SkColor button_color_; | 396 SkColor button_color_; |
407 | 397 |
408 // As the majority of the tabs are inactive, and painting tabs is slowish, | 398 // As the majority of the tabs are inactive, and painting tabs is slowish, |
409 // we cache a handful of the inactive tab backgrounds here. | 399 // we cache a handful of the inactive tab backgrounds here. |
410 static ImageCache* image_cache_; | 400 static ImageCache* image_cache_; |
411 | 401 |
412 DISALLOW_COPY_AND_ASSIGN(Tab); | 402 DISALLOW_COPY_AND_ASSIGN(Tab); |
413 }; | 403 }; |
414 | 404 |
415 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 405 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
OLD | NEW |