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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas); | 239 void PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas); |
240 void PaintInactiveTabBackground(gfx::Canvas* canvas); | 240 void PaintInactiveTabBackground(gfx::Canvas* canvas); |
241 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, | 241 void PaintInactiveTabBackgroundUsingResourceId(gfx::Canvas* canvas, |
242 int tab_id); | 242 int tab_id); |
243 void PaintActiveTabBackground(gfx::Canvas* canvas); | 243 void PaintActiveTabBackground(gfx::Canvas* canvas); |
244 | 244 |
245 // Paints the favicon, mirrored for RTL if needed. | 245 // Paints the favicon, mirrored for RTL if needed. |
246 void PaintIcon(gfx::Canvas* canvas); | 246 void PaintIcon(gfx::Canvas* canvas); |
247 | 247 |
248 // Invoked if data_.network_state changes, or the network_state is not none. | 248 // Invoked if data_.network_state changes, or the network_state is not none. |
249 void AdvanceLoadingAnimation(TabRendererData::NetworkState old_state, | 249 void AdvanceLoadingAnimation(TabRendererData::NetworkState state); |
250 TabRendererData::NetworkState state); | |
251 | 250 |
252 // Returns the number of favicon-size elements that can fit in the tab's | 251 // Returns the number of favicon-size elements that can fit in the tab's |
253 // current size. | 252 // current size. |
254 int IconCapacity() const; | 253 int IconCapacity() const; |
255 | 254 |
256 // Returns whether the Tab should display a favicon. | 255 // Returns whether the Tab should display a favicon. |
257 bool ShouldShowIcon() const; | 256 bool ShouldShowIcon() const; |
258 | 257 |
259 // Returns whether the Tab should display the media indicator. | 258 // Returns whether the Tab should display the media indicator. |
260 bool ShouldShowMediaIndicator() const; | 259 bool ShouldShowMediaIndicator() const; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 // True if the tab is being dragged. | 333 // True if the tab is being dragged. |
335 bool dragging_; | 334 bool dragging_; |
336 | 335 |
337 // True if the tab has been detached. | 336 // True if the tab has been detached. |
338 bool detached_; | 337 bool detached_; |
339 | 338 |
340 // The offset used to animate the favicon location. This is used when the tab | 339 // The offset used to animate the favicon location. This is used when the tab |
341 // crashes. | 340 // crashes. |
342 int favicon_hiding_offset_; | 341 int favicon_hiding_offset_; |
343 | 342 |
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. | 343 // Step in the immersive loading progress indicator. |
354 int immersive_loading_step_; | 344 int immersive_loading_step_; |
355 | 345 |
356 bool should_display_crashed_favicon_; | 346 bool should_display_crashed_favicon_; |
357 | 347 |
358 // Whole-tab throbbing "pulse" animation. | 348 // Whole-tab throbbing "pulse" animation. |
359 scoped_ptr<gfx::ThrobAnimation> pulse_animation_; | 349 scoped_ptr<gfx::ThrobAnimation> pulse_animation_; |
360 | 350 |
361 scoped_ptr<gfx::MultiAnimation> pinned_title_change_animation_; | 351 scoped_ptr<gfx::MultiAnimation> pinned_title_change_animation_; |
362 | 352 |
363 // Crash icon animation (in place of favicon). | 353 // Crash icon animation (in place of favicon). |
364 scoped_ptr<gfx::LinearAnimation> crash_icon_animation_; | 354 scoped_ptr<gfx::LinearAnimation> crash_icon_animation_; |
365 | 355 |
366 scoped_refptr<gfx::AnimationContainer> animation_container_; | 356 scoped_refptr<gfx::AnimationContainer> animation_container_; |
367 | 357 |
358 views::View* throbber_; | |
danakj
2015/10/08 14:09:01
can this be a scoped_ptr?
sky
2015/10/08 15:52:23
Generally we don't do that as views are implicitly
| |
368 MediaIndicatorButton* media_indicator_button_; | 359 MediaIndicatorButton* media_indicator_button_; |
369 views::ImageButton* close_button_; | 360 views::ImageButton* close_button_; |
370 views::Label* title_; | 361 views::Label* title_; |
371 | 362 |
372 bool tab_activated_with_last_tap_down_; | 363 bool tab_activated_with_last_tap_down_; |
373 | 364 |
374 views::GlowHoverController hover_controller_; | 365 views::GlowHoverController hover_controller_; |
375 | 366 |
376 // The bounds of various sections of the display. | 367 // The bounds of various sections of the display. |
377 gfx::Rect favicon_bounds_; | 368 gfx::Rect favicon_bounds_; |
(...skipping 28 matching lines...) Expand all Loading... | |
406 SkColor button_color_; | 397 SkColor button_color_; |
407 | 398 |
408 // As the majority of the tabs are inactive, and painting tabs is slowish, | 399 // As the majority of the tabs are inactive, and painting tabs is slowish, |
409 // we cache a handful of the inactive tab backgrounds here. | 400 // we cache a handful of the inactive tab backgrounds here. |
410 static ImageCache* image_cache_; | 401 static ImageCache* image_cache_; |
411 | 402 |
412 DISALLOW_COPY_AND_ASSIGN(Tab); | 403 DISALLOW_COPY_AND_ASSIGN(Tab); |
413 }; | 404 }; |
414 | 405 |
415 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ | 406 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_ |
OLD | NEW |