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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 // | 348 // |
349 //////////////////////////////////////////////////////////////////////////////// | 349 //////////////////////////////////////////////////////////////////////////////// |
350 | 350 |
351 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 351 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
352 // won't be deleted until it's last InvokeLater is run. | 352 // won't be deleted until it's last InvokeLater is run. |
353 DISABLE_RUNNABLE_METHOD_REFCOUNT(MediaPlayer); | 353 DISABLE_RUNNABLE_METHOD_REFCOUNT(MediaPlayer); |
354 | 354 |
355 MediaPlayer::~MediaPlayer() { | 355 MediaPlayer::~MediaPlayer() { |
356 } | 356 } |
357 | 357 |
| 358 // static |
| 359 MediaPlayer* MediaPlayer::Get() { |
| 360 return Singleton<MediaPlayer>::get(); |
| 361 } |
| 362 |
358 void MediaPlayer::EnqueueMediaURL(const GURL& url, Browser* creator) { | 363 void MediaPlayer::EnqueueMediaURL(const GURL& url, Browser* creator) { |
359 if (!Enabled()) { | 364 if (!Enabled()) { |
360 return; | 365 return; |
361 } | 366 } |
362 if (handler_ == NULL) { | 367 if (handler_ == NULL) { |
363 unhandled_urls_.push_back(url); | 368 unhandled_urls_.push_back(url); |
364 PopupMediaPlayer(creator); | 369 PopupMediaPlayer(creator); |
365 } else { | 370 } else { |
366 handler_->EnqueueMediaFile(url); | 371 handler_->EnqueueMediaFile(url); |
367 } | 372 } |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 new MediaplayerUIHTMLSource(is_playlist); | 612 new MediaplayerUIHTMLSource(is_playlist); |
608 | 613 |
609 // Set up the chrome://mediaplayer/ source. | 614 // Set up the chrome://mediaplayer/ source. |
610 BrowserThread::PostTask( | 615 BrowserThread::PostTask( |
611 BrowserThread::IO, FROM_HERE, | 616 BrowserThread::IO, FROM_HERE, |
612 NewRunnableMethod( | 617 NewRunnableMethod( |
613 ChromeURLDataManager::GetInstance(), | 618 ChromeURLDataManager::GetInstance(), |
614 &ChromeURLDataManager::AddDataSource, | 619 &ChromeURLDataManager::AddDataSource, |
615 make_scoped_refptr(html_source))); | 620 make_scoped_refptr(html_source))); |
616 } | 621 } |
OLD | NEW |