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/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 mediaplayer_tab_ = NULL; | 513 mediaplayer_tab_ = NULL; |
514 } | 514 } |
515 } | 515 } |
516 | 516 |
517 void MediaPlayer::PopupPlaylist(Browser* creator) { | 517 void MediaPlayer::PopupPlaylist(Browser* creator) { |
518 Profile* profile = BrowserList::GetLastActive()->profile(); | 518 Profile* profile = BrowserList::GetLastActive()->profile(); |
519 playlist_browser_ = Browser::CreateForType(Browser::TYPE_APP_PANEL, | 519 playlist_browser_ = Browser::CreateForType(Browser::TYPE_APP_PANEL, |
520 profile); | 520 profile); |
521 playlist_browser_->AddTabWithURL( | 521 playlist_browser_->AddTabWithURL( |
522 GURL(kMediaplayerPlaylistURL), GURL(), PageTransition::LINK, | 522 GURL(kMediaplayerPlaylistURL), GURL(), PageTransition::LINK, |
523 -1, TabStripModel::ADD_SELECTED, NULL, std::string()); | 523 -1, TabStripModel::ADD_SELECTED, NULL, std::string(), |
| 524 &playlist_browser_); |
524 playlist_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, | 525 playlist_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, |
525 kPopupTop, | 526 kPopupTop, |
526 kPopupWidth, | 527 kPopupWidth, |
527 kPopupHeight)); | 528 kPopupHeight)); |
528 playlist_browser_->window()->Show(); | 529 playlist_browser_->window()->Show(); |
529 } | 530 } |
530 | 531 |
531 void MediaPlayer::PopupMediaPlayer(Browser* creator) { | 532 void MediaPlayer::PopupMediaPlayer(Browser* creator) { |
532 if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { | 533 if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { |
533 ChromeThread::PostTask( | 534 ChromeThread::PostTask( |
(...skipping 12 matching lines...) Expand all Loading... |
546 chromeos::PanelBrowserView* creatorview = | 547 chromeos::PanelBrowserView* creatorview = |
547 static_cast<chromeos::PanelBrowserView*>(creator->window()); | 548 static_cast<chromeos::PanelBrowserView*>(creator->window()); |
548 chromeos::PanelBrowserView* view = | 549 chromeos::PanelBrowserView* view = |
549 static_cast<chromeos::PanelBrowserView*>( | 550 static_cast<chromeos::PanelBrowserView*>( |
550 mediaplayer_browser_->window()); | 551 mediaplayer_browser_->window()); |
551 view->SetCreatorView(creatorview); | 552 view->SetCreatorView(creatorview); |
552 } | 553 } |
553 #endif | 554 #endif |
554 mediaplayer_browser_->AddTabWithURL( | 555 mediaplayer_browser_->AddTabWithURL( |
555 GURL(kMediaplayerURL), GURL(), PageTransition::LINK, | 556 GURL(kMediaplayerURL), GURL(), PageTransition::LINK, |
556 -1, TabStripModel::ADD_SELECTED, NULL, std::string()); | 557 -1, TabStripModel::ADD_SELECTED, NULL, std::string(), |
| 558 &mediaplayer_browser_); |
557 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, | 559 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, |
558 kPopupTop, | 560 kPopupTop, |
559 kPopupWidth, | 561 kPopupWidth, |
560 kPopupHeight)); | 562 kPopupHeight)); |
561 mediaplayer_browser_->window()->Show(); | 563 mediaplayer_browser_->window()->Show(); |
562 } | 564 } |
563 | 565 |
564 URLRequestJob* MediaPlayer::MaybeIntercept(URLRequest* request) { | 566 URLRequestJob* MediaPlayer::MaybeIntercept(URLRequest* request) { |
565 // Don't attempt to intercept here as we want to wait until the mime | 567 // Don't attempt to intercept here as we want to wait until the mime |
566 // type is fully determined. | 568 // type is fully determined. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 new MediaplayerUIHTMLSource(is_playlist); | 632 new MediaplayerUIHTMLSource(is_playlist); |
631 | 633 |
632 // Set up the chrome://mediaplayer/ source. | 634 // Set up the chrome://mediaplayer/ source. |
633 ChromeThread::PostTask( | 635 ChromeThread::PostTask( |
634 ChromeThread::IO, FROM_HERE, | 636 ChromeThread::IO, FROM_HERE, |
635 NewRunnableMethod( | 637 NewRunnableMethod( |
636 Singleton<ChromeURLDataManager>::get(), | 638 Singleton<ChromeURLDataManager>::get(), |
637 &ChromeURLDataManager::AddDataSource, | 639 &ChromeURLDataManager::AddDataSource, |
638 make_scoped_refptr(html_source))); | 640 make_scoped_refptr(html_source))); |
639 } | 641 } |
OLD | NEW |