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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 #endif | 536 #endif |
537 mediaplayer_browser_->AddSelectedTabWithURL(GURL(kMediaplayerURL), | 537 mediaplayer_browser_->AddSelectedTabWithURL(GURL(kMediaplayerURL), |
538 PageTransition::LINK); | 538 PageTransition::LINK); |
539 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, | 539 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, |
540 kPopupTop, | 540 kPopupTop, |
541 kPopupWidth, | 541 kPopupWidth, |
542 kPopupHeight)); | 542 kPopupHeight)); |
543 mediaplayer_browser_->window()->Show(); | 543 mediaplayer_browser_->window()->Show(); |
544 } | 544 } |
545 | 545 |
546 URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) { | 546 net::URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) { |
547 // Don't attempt to intercept here as we want to wait until the mime | 547 // Don't attempt to intercept here as we want to wait until the mime |
548 // type is fully determined. | 548 // type is fully determined. |
549 return NULL; | 549 return NULL; |
550 } | 550 } |
551 | 551 |
552 // This is the list of mime types currently supported by the Google | 552 // This is the list of mime types currently supported by the Google |
553 // Document Viewer. | 553 // Document Viewer. |
554 static const char* const supported_mime_type_list[] = { | 554 static const char* const supported_mime_type_list[] = { |
555 "audio/mpeg", | 555 "audio/mpeg", |
556 "video/mp4", | 556 "video/mp4", |
557 "audio/mp3" | 557 "audio/mp3" |
558 }; | 558 }; |
559 | 559 |
560 URLRequestJob* MediaPlayer::MaybeInterceptResponse( | 560 net::URLRequestJob* MediaPlayer::MaybeInterceptResponse( |
561 net::URLRequest* request) { | 561 net::URLRequest* request) { |
562 // Do not intercept this request if it is a download. | 562 // Do not intercept this request if it is a download. |
563 if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { | 563 if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { |
564 return NULL; | 564 return NULL; |
565 } | 565 } |
566 | 566 |
567 std::string mime_type; | 567 std::string mime_type; |
568 request->GetMimeType(&mime_type); | 568 request->GetMimeType(&mime_type); |
569 // If it is in our list of known URLs, enqueue the url then | 569 // If it is in our list of known URLs, enqueue the url then |
570 // Cancel the request so the mediaplayer can handle it when | 570 // Cancel the request so the mediaplayer can handle it when |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 new MediaplayerUIHTMLSource(is_playlist); | 612 new MediaplayerUIHTMLSource(is_playlist); |
613 | 613 |
614 // Set up the chrome://mediaplayer/ source. | 614 // Set up the chrome://mediaplayer/ source. |
615 BrowserThread::PostTask( | 615 BrowserThread::PostTask( |
616 BrowserThread::IO, FROM_HERE, | 616 BrowserThread::IO, FROM_HERE, |
617 NewRunnableMethod( | 617 NewRunnableMethod( |
618 ChromeURLDataManager::GetInstance(), | 618 ChromeURLDataManager::GetInstance(), |
619 &ChromeURLDataManager::AddDataSource, | 619 &ChromeURLDataManager::AddDataSource, |
620 make_scoped_refptr(html_source))); | 620 make_scoped_refptr(html_source))); |
621 } | 621 } |
OLD | NEW |