summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/mediaplayer_ui.cc
diff options
context:
space:
mode:
authordhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 00:00:50 +0000
committerdhg@chromium.org <dhg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 00:00:50 +0000
commit1ce78d4ea96c1b980d26e60cd19f756ca6765e01 (patch)
treed7b7f65e77ec0080a93e5b1bab1e80a6e50fdee5 /chrome/browser/dom_ui/mediaplayer_ui.cc
parente64acae98b10447395df572775c807b985d972a8 (diff)
downloadchromium_src-1ce78d4ea96c1b980d26e60cd19f756ca6765e01.zip
chromium_src-1ce78d4ea96c1b980d26e60cd19f756ca6765e01.tar.gz
chromium_src-1ce78d4ea96c1b980d26e60cd19f756ca6765e01.tar.bz2
adding fullscreen support to the mediaplayer.
Tested by loading on device and clicking fullscreen button. (needs most recent codebase) Review URL: http://codereview.chromium.org/1034002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/mediaplayer_ui.cc')
-rw-r--r--chrome/browser/dom_ui/mediaplayer_ui.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/mediaplayer_ui.cc b/chrome/browser/dom_ui/mediaplayer_ui.cc
index 0633af5..f561603 100644
--- a/chrome/browser/dom_ui/mediaplayer_ui.cc
+++ b/chrome/browser/dom_ui/mediaplayer_ui.cc
@@ -104,6 +104,8 @@ class MediaplayerHandler : public DOMMessageHandler,
void HandleTogglePlaylist(const Value* value);
void HandleSetCurrentPlaylistOffset(const Value* value);
+ void HandleToggleFullscreen(const Value* value);
+
const std::vector<GURL>& GetCurrentPlaylist();
@@ -214,6 +216,8 @@ void MediaplayerHandler::RegisterMessages() {
NewCallback(this, &MediaplayerHandler::HandleTogglePlaylist));
dom_ui_->RegisterMessageCallback("setCurrentPlaylistOffset",
NewCallback(this, &MediaplayerHandler::HandleSetCurrentPlaylistOffset));
+ dom_ui_->RegisterMessageCallback("toggleFullscreen",
+ NewCallback(this, &MediaplayerHandler::HandleToggleFullscreen));
}
void MediaplayerHandler::GetPlaylistValue(ListValue& value) {
@@ -246,6 +250,10 @@ int MediaplayerHandler::GetCurrentPlaylistOffset() {
return currentOffset_;
}
+void MediaplayerHandler::HandleToggleFullscreen(const Value* value) {
+ MediaPlayer::Get()->ToggleFullscreen();
+}
+
void MediaplayerHandler::HandleSetCurrentPlaylistOffset(const Value* value) {
ListValue results_value;
DictionaryValue info_value;
@@ -465,6 +473,12 @@ void MediaPlayer::NotifyPlaylistChanged() {
}
}
+void MediaPlayer::ToggleFullscreen() {
+ if (handler_ && mediaplayer_browser_) {
+ mediaplayer_browser_->ToggleFullscreenMode();
+ }
+}
+
void MediaPlayer::RemoveHandler(MediaplayerHandler* handler) {
if (handler == handler_) {
handler_ = NULL;