Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 m_timeline.get(), | 694 m_timeline.get(), |
| 695 m_currentTimeDisplay.get(), | 695 m_currentTimeDisplay.get(), |
| 696 m_volumeSlider.get(), | 696 m_volumeSlider.get(), |
| 697 m_castButton.get(), | 697 m_castButton.get(), |
| 698 m_muteButton.get(), | 698 m_muteButton.get(), |
| 699 m_durationDisplay.get(), | 699 m_durationDisplay.get(), |
| 700 }; | 700 }; |
| 701 | 701 |
| 702 int usedWidth = 0; | 702 int usedWidth = 0; |
| 703 bool droppedCastButton = false; | 703 bool droppedCastButton = false; |
| 704 // Assume that all controls require 48px. Ideally, we could get this from | 704 |
| 705 // the computed style, but that requires the controls to be shown. | 705 // Assume that all controls require 48px, unless we can get the computed |
| 706 const int minimumWidth = 48; | 706 // style for the play button. Since the play button is always shown, it |
| 707 // should be available the first time we're called after layout. This will | |
| 708 // also be the first time we have m_panelWidth!=0, so it won't matter if | |
| 709 // we get this wrong before that. | |
| 710 int minimumWidth = (m_playButton->layoutObject() && m_playButton->layoutObje ct()->style()) | |
| 711 ? m_playButton->layoutObject()->style()->width().pixels() | |
| 712 : 48; | |
|
mlamouri (slow - plz ping)
2016/05/09 12:41:39
`minimumWidth` is being used by all elements in `e
| |
| 707 | 713 |
| 708 // Special-case the play button; it always fits. | 714 // Special-case the play button; it always fits. |
| 709 if (m_playButton->isWanted()) { | 715 if (m_playButton->isWanted()) { |
| 710 m_playButton->setDoesFit(true); | 716 m_playButton->setDoesFit(true); |
| 711 usedWidth += minimumWidth; | 717 usedWidth += minimumWidth; |
| 712 } | 718 } |
| 713 | 719 |
| 714 if (!m_panelWidth) { | 720 if (!m_panelWidth) { |
| 715 // No layout yet -- hide everything, then make them show up later. | 721 // No layout yet -- hide everything, then make them show up later. |
| 716 // This prevents the wrong controls from being shown briefly | 722 // This prevents the wrong controls from being shown briefly |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 791 visitor->trace(m_fullScreenButton); | 797 visitor->trace(m_fullScreenButton); |
| 792 visitor->trace(m_durationDisplay); | 798 visitor->trace(m_durationDisplay); |
| 793 visitor->trace(m_enclosure); | 799 visitor->trace(m_enclosure); |
| 794 visitor->trace(m_textTrackList); | 800 visitor->trace(m_textTrackList); |
| 795 visitor->trace(m_castButton); | 801 visitor->trace(m_castButton); |
| 796 visitor->trace(m_overlayCastButton); | 802 visitor->trace(m_overlayCastButton); |
| 797 HTMLDivElement::trace(visitor); | 803 HTMLDivElement::trace(visitor); |
| 798 } | 804 } |
| 799 | 805 |
| 800 } // namespace blink | 806 } // namespace blink |
| OLD | NEW |