OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/dom_ui/mediaplayer_ui.h" | 5 #include "chrome/browser/dom_ui/mediaplayer_ui.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 #endif | 531 #endif |
532 mediaplayer_browser_->AddSelectedTabWithURL(GURL(kMediaplayerURL), | 532 mediaplayer_browser_->AddSelectedTabWithURL(GURL(kMediaplayerURL), |
533 PageTransition::LINK); | 533 PageTransition::LINK); |
534 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, | 534 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, |
535 kPopupTop, | 535 kPopupTop, |
536 kPopupWidth, | 536 kPopupWidth, |
537 kPopupHeight)); | 537 kPopupHeight)); |
538 mediaplayer_browser_->window()->Show(); | 538 mediaplayer_browser_->window()->Show(); |
539 } | 539 } |
540 | 540 |
541 URLRequestJob* MediaPlayer::MaybeIntercept(URLRequest* request) { | 541 URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) { |
542 // Don't attempt to intercept here as we want to wait until the mime | 542 // Don't attempt to intercept here as we want to wait until the mime |
543 // type is fully determined. | 543 // type is fully determined. |
544 return NULL; | 544 return NULL; |
545 } | 545 } |
546 | 546 |
547 // This is the list of mime types currently supported by the Google | 547 // This is the list of mime types currently supported by the Google |
548 // Document Viewer. | 548 // Document Viewer. |
549 static const char* const supported_mime_type_list[] = { | 549 static const char* const supported_mime_type_list[] = { |
550 "audio/mpeg", | 550 "audio/mpeg", |
551 "video/mp4", | 551 "video/mp4", |
552 "audio/mp3" | 552 "audio/mp3" |
553 }; | 553 }; |
554 | 554 |
555 URLRequestJob* MediaPlayer::MaybeInterceptResponse( | 555 URLRequestJob* MediaPlayer::MaybeInterceptResponse( |
556 URLRequest* request) { | 556 net::URLRequest* request) { |
557 // Do not intercept this request if it is a download. | 557 // Do not intercept this request if it is a download. |
558 if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { | 558 if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { |
559 return NULL; | 559 return NULL; |
560 } | 560 } |
561 | 561 |
562 std::string mime_type; | 562 std::string mime_type; |
563 request->GetMimeType(&mime_type); | 563 request->GetMimeType(&mime_type); |
564 // If it is in our list of known URLs, enqueue the url then | 564 // If it is in our list of known URLs, enqueue the url then |
565 // Cancel the request so the mediaplayer can handle it when | 565 // Cancel the request so the mediaplayer can handle it when |
566 // it hits it in the playlist. | 566 // it hits it in the playlist. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 new MediaplayerUIHTMLSource(is_playlist); | 607 new MediaplayerUIHTMLSource(is_playlist); |
608 | 608 |
609 // Set up the chrome://mediaplayer/ source. | 609 // Set up the chrome://mediaplayer/ source. |
610 BrowserThread::PostTask( | 610 BrowserThread::PostTask( |
611 BrowserThread::IO, FROM_HERE, | 611 BrowserThread::IO, FROM_HERE, |
612 NewRunnableMethod( | 612 NewRunnableMethod( |
613 Singleton<ChromeURLDataManager>::get(), | 613 Singleton<ChromeURLDataManager>::get(), |
614 &ChromeURLDataManager::AddDataSource, | 614 &ChromeURLDataManager::AddDataSource, |
615 make_scoped_refptr(html_source))); | 615 make_scoped_refptr(html_source))); |
616 } | 616 } |
OLD | NEW |