Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp

Issue 2237553002: [M53] Adjust MediaControls for effective zoom when dropping controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 m_durationDisplay.get(), 699 m_durationDisplay.get(),
700 }; 700 };
701 701
702 int usedWidth = 0; 702 int usedWidth = 0;
703 703
704 // Assume that all controls require 48px, unless we can get the computed 704 // Assume that all controls require 48px, unless we can get the computed
705 // style for the play button. Since the play button is always shown, it 705 // style for the play button. Since the play button is always shown, it
706 // should be available the first time we're called after layout. This will 706 // should be available the first time we're called after layout. This will
707 // also be the first time we have m_panelWidth!=0, so it won't matter if 707 // also be the first time we have m_panelWidth!=0, so it won't matter if
708 // we get this wrong before that. 708 // we get this wrong before that.
709 int minimumWidth = (m_playButton->layoutObject() && m_playButton->layoutObje ct()->style()) 709 int minimumWidth = 48;
710 ? m_playButton->layoutObject()->style()->width().pixels() 710 if (m_playButton->layoutObject() && m_playButton->layoutObject()->style()) {
711 : 48; 711 const ComputedStyle* style = m_playButton->layoutObject()->style();
712 minimumWidth = ceil(style->width().pixels() / style->effectiveZoom());
713 }
712 714
713 // Special-case the play button; it always fits. 715 // Special-case the play button; it always fits.
714 if (m_playButton->isWanted()) { 716 if (m_playButton->isWanted()) {
715 m_playButton->setDoesFit(true); 717 m_playButton->setDoesFit(true);
716 usedWidth += minimumWidth; 718 usedWidth += minimumWidth;
717 } 719 }
718 720
719 if (!m_panelWidth) { 721 if (!m_panelWidth) {
720 // No layout yet -- hide everything, then make them show up later. 722 // No layout yet -- hide everything, then make them show up later.
721 // This prevents the wrong controls from being shown briefly 723 // This prevents the wrong controls from being shown briefly
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 visitor->trace(m_fullScreenButton); 799 visitor->trace(m_fullScreenButton);
798 visitor->trace(m_durationDisplay); 800 visitor->trace(m_durationDisplay);
799 visitor->trace(m_enclosure); 801 visitor->trace(m_enclosure);
800 visitor->trace(m_textTrackList); 802 visitor->trace(m_textTrackList);
801 visitor->trace(m_castButton); 803 visitor->trace(m_castButton);
802 visitor->trace(m_overlayCastButton); 804 visitor->trace(m_overlayCastButton);
803 HTMLDivElement::trace(visitor); 805 HTMLDivElement::trace(visitor);
804 } 806 }
805 807
806 } // namespace blink 808 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698