| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "modules/media_controls/elements/MediaControlCastButtonElement.h" | 5 #include "modules/media_controls/elements/MediaControlCastButtonElement.h" |
| 6 | 6 |
| 7 #include "core/InputTypeNames.h" | 7 #include "core/InputTypeNames.h" |
| 8 #include "core/dom/ClientRect.h" | 8 #include "core/dom/ClientRect.h" |
| 9 #include "core/events/Event.h" | 9 #include "core/events/Event.h" |
| 10 #include "core/html/HTMLMediaElement.h" | 10 #include "core/html/HTMLMediaElement.h" |
| 11 #include "modules/media_controls/MediaControlsImpl.h" | 11 #include "modules/media_controls/MediaControlsImpl.h" |
| 12 #include "modules/media_controls/elements/MediaControlElementsHelper.h" | 12 #include "modules/media_controls/elements/MediaControlElementsHelper.h" |
| 13 #include "platform/Histogram.h" |
| 13 #include "public/platform/Platform.h" | 14 #include "public/platform/Platform.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 | 19 |
| 19 Element* ElementFromCenter(Element& element) { | 20 Element* ElementFromCenter(Element& element) { |
| 20 ClientRect* client_rect = element.getBoundingClientRect(); | 21 ClientRect* client_rect = element.getBoundingClientRect(); |
| 21 int center_x = | 22 int center_x = |
| 22 static_cast<int>((client_rect->left() + client_rect->right()) / 2); | 23 static_cast<int>((client_rect->left() + client_rect->right()) / 2); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 123 |
| 123 void MediaControlCastButtonElement::RecordMetrics(CastOverlayMetrics metric) { | 124 void MediaControlCastButtonElement::RecordMetrics(CastOverlayMetrics metric) { |
| 124 DCHECK(is_overlay_button_); | 125 DCHECK(is_overlay_button_); |
| 125 DEFINE_STATIC_LOCAL( | 126 DEFINE_STATIC_LOCAL( |
| 126 EnumerationHistogram, overlay_histogram, | 127 EnumerationHistogram, overlay_histogram, |
| 127 ("Cast.Sender.Overlay", static_cast<int>(CastOverlayMetrics::kCount))); | 128 ("Cast.Sender.Overlay", static_cast<int>(CastOverlayMetrics::kCount))); |
| 128 overlay_histogram.Count(static_cast<int>(metric)); | 129 overlay_histogram.Count(static_cast<int>(metric)); |
| 129 } | 130 } |
| 130 | 131 |
| 131 } // namespace blink | 132 } // namespace blink |
| OLD | NEW |