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

Side by Side Diff: Source/core/html/shadow/MediaControlsChromiumAndroid.cpp

Issue 157403002: Merge MediaControlsChromium into MediaControls (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/shadow/MediaControlsChromiumAndroid.h ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 14 matching lines...) Expand all
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "core/html/shadow/MediaControlsChromiumAndroid.h" 27 #include "core/html/shadow/MediaControlsChromiumAndroid.h"
28 28
29 #include "bindings/v8/ExceptionState.h" 29 #include "bindings/v8/ExceptionState.h"
30 #include "bindings/v8/ExceptionStatePlaceholder.h" 30 #include "bindings/v8/ExceptionStatePlaceholder.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 MediaControlsChromiumAndroid::MediaControlsChromiumAndroid(Document& document) 34 MediaControlsChromiumAndroid::MediaControlsChromiumAndroid(Document& document)
35 : MediaControlsChromium(document) 35 : MediaControls(document)
36 , m_overlayPlayButton(0) 36 , m_overlayPlayButton(0)
37 , m_overlayEnclosure(0) 37 , m_overlayEnclosure(0)
38 { 38 {
39 } 39 }
40 40
41 PassRefPtr<MediaControls> MediaControls::create(Document& document) 41 PassRefPtr<MediaControls> MediaControls::create(Document& document)
42 { 42 {
43 return MediaControlsChromiumAndroid::createControls(document);
44 }
45
46 PassRefPtr<MediaControlsChromiumAndroid> MediaControlsChromiumAndroid::createCon trols(Document& document)
47 {
48 if (!document.page()) 43 if (!document.page())
49 return 0; 44 return 0;
50 45
51 RefPtr<MediaControlsChromiumAndroid> controls = adoptRef(new MediaControlsCh romiumAndroid(document)); 46 RefPtr<MediaControlsChromiumAndroid> controls = adoptRef(new MediaControlsCh romiumAndroid(document));
52 47
53 TrackExceptionState exceptionState; 48 TrackExceptionState exceptionState;
54 49
55 RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlO verlayEnclosureElement::create(document); 50 RefPtr<MediaControlOverlayEnclosureElement> overlayEnclosure = MediaControlO verlayEnclosureElement::create(document);
56 RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaContro lOverlayPlayButtonElement::create(document); 51 RefPtr<MediaControlOverlayPlayButtonElement> overlayPlayButton = MediaContro lOverlayPlayButtonElement::create(document);
57 controls->m_overlayPlayButton = overlayPlayButton.get(); 52 controls->m_overlayPlayButton = overlayPlayButton.get();
(...skipping 11 matching lines...) Expand all
69 64
70 return 0; 65 return 0;
71 } 66 }
72 67
73 void MediaControlsChromiumAndroid::setMediaController(MediaControllerInterface* controller) 68 void MediaControlsChromiumAndroid::setMediaController(MediaControllerInterface* controller)
74 { 69 {
75 if (m_overlayPlayButton) 70 if (m_overlayPlayButton)
76 m_overlayPlayButton->setMediaController(controller); 71 m_overlayPlayButton->setMediaController(controller);
77 if (m_overlayEnclosure) 72 if (m_overlayEnclosure)
78 m_overlayEnclosure->setMediaController(controller); 73 m_overlayEnclosure->setMediaController(controller);
79 MediaControlsChromium::setMediaController(controller); 74 MediaControls::setMediaController(controller);
80 } 75 }
81 76
82 void MediaControlsChromiumAndroid::playbackStarted() 77 void MediaControlsChromiumAndroid::playbackStarted()
83 { 78 {
84 m_overlayPlayButton->updateDisplayType(); 79 m_overlayPlayButton->updateDisplayType();
85 MediaControlsChromium::playbackStarted(); 80 MediaControls::playbackStarted();
86 } 81 }
87 82
88 void MediaControlsChromiumAndroid::playbackStopped() 83 void MediaControlsChromiumAndroid::playbackStopped()
89 { 84 {
90 m_overlayPlayButton->updateDisplayType(); 85 m_overlayPlayButton->updateDisplayType();
91 MediaControlsChromium::playbackStopped(); 86 MediaControls::playbackStopped();
92 } 87 }
93 88
94 void MediaControlsChromiumAndroid::insertTextTrackContainer(PassRefPtr<MediaCont rolTextTrackContainerElement> textTrackContainer) 89 void MediaControlsChromiumAndroid::insertTextTrackContainer(PassRefPtr<MediaCont rolTextTrackContainerElement> textTrackContainer)
95 { 90 {
96 // Insert it before the overlay play button so it always displays behind it. 91 // Insert it before the overlay play button so it always displays behind it.
97 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton); 92 m_overlayEnclosure->insertBefore(textTrackContainer, m_overlayPlayButton);
98 } 93 }
99 } 94 }
OLDNEW
« no previous file with comments | « Source/core/html/shadow/MediaControlsChromiumAndroid.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698