OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/media/media_player.h" | 5 #include "chrome/browser/chromeos/media/media_player.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 Profile* profile = BrowserList::GetLastActive()->profile(); | 188 Profile* profile = BrowserList::GetLastActive()->profile(); |
189 playlist_browser_ = Browser::CreateForApp(Browser::TYPE_PANEL, | 189 playlist_browser_ = Browser::CreateForApp(Browser::TYPE_PANEL, |
190 kMediaPlayerAppName, | 190 kMediaPlayerAppName, |
191 gfx::Rect(), | 191 gfx::Rect(), |
192 profile); | 192 profile); |
193 registrar_.Add(this, | 193 registrar_.Add(this, |
194 chrome::NOTIFICATION_BROWSER_CLOSED, | 194 chrome::NOTIFICATION_BROWSER_CLOSED, |
195 Source<Browser>(playlist_browser_)); | 195 Source<Browser>(playlist_browser_)); |
196 playlist_browser_->AddSelectedTabWithURL(GetMediaplayerPlaylistUrl(), | 196 playlist_browser_->AddSelectedTabWithURL(GetMediaplayerPlaylistUrl(), |
197 PageTransition::LINK); | 197 content::PAGE_TRANSITION_LINK); |
198 playlist_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, | 198 playlist_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, |
199 kPopupTop, | 199 kPopupTop, |
200 kPopupWidth, | 200 kPopupWidth, |
201 kPopupHeight)); | 201 kPopupHeight)); |
202 playlist_browser_->window()->Show(); | 202 playlist_browser_->window()->Show(); |
203 } | 203 } |
204 | 204 |
205 void MediaPlayer::PopupMediaPlayer(Browser* creator) { | 205 void MediaPlayer::PopupMediaPlayer(Browser* creator) { |
206 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 206 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
207 BrowserThread::PostTask( | 207 BrowserThread::PostTask( |
(...skipping 20 matching lines...) Expand all Loading... |
228 if (creator) { | 228 if (creator) { |
229 chromeos::PanelBrowserView* creatorview = | 229 chromeos::PanelBrowserView* creatorview = |
230 static_cast<chromeos::PanelBrowserView*>(creator->window()); | 230 static_cast<chromeos::PanelBrowserView*>(creator->window()); |
231 chromeos::PanelBrowserView* view = | 231 chromeos::PanelBrowserView* view = |
232 static_cast<chromeos::PanelBrowserView*>( | 232 static_cast<chromeos::PanelBrowserView*>( |
233 mediaplayer_browser_->window()); | 233 mediaplayer_browser_->window()); |
234 view->SetCreatorView(creatorview); | 234 view->SetCreatorView(creatorview); |
235 } | 235 } |
236 #endif | 236 #endif |
237 mediaplayer_browser_->AddSelectedTabWithURL(GetMediaPlayerUrl(), | 237 mediaplayer_browser_->AddSelectedTabWithURL(GetMediaPlayerUrl(), |
238 PageTransition::LINK); | 238 content::PAGE_TRANSITION_LINK); |
239 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, | 239 mediaplayer_browser_->window()->SetBounds(gfx::Rect(kPopupLeft, |
240 kPopupTop, | 240 kPopupTop, |
241 kPopupWidth, | 241 kPopupWidth, |
242 kPopupHeight)); | 242 kPopupHeight)); |
243 mediaplayer_browser_->window()->Show(); | 243 mediaplayer_browser_->window()->Show(); |
244 } | 244 } |
245 | 245 |
246 net::URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) { | 246 net::URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) { |
247 // Don't attempt to intercept here as we want to wait until the mime | 247 // Don't attempt to intercept here as we want to wait until the mime |
248 // type is fully determined. | 248 // type is fully determined. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 MediaPlayer::MediaPlayer() | 295 MediaPlayer::MediaPlayer() |
296 : current_position_(0), | 296 : current_position_(0), |
297 pending_playback_request_(false), | 297 pending_playback_request_(false), |
298 playlist_browser_(NULL), | 298 playlist_browser_(NULL), |
299 mediaplayer_browser_(NULL) { | 299 mediaplayer_browser_(NULL) { |
300 for (size_t i = 0; i < arraysize(supported_mime_type_list); ++i) { | 300 for (size_t i = 0; i < arraysize(supported_mime_type_list); ++i) { |
301 supported_mime_types_.insert(supported_mime_type_list[i]); | 301 supported_mime_types_.insert(supported_mime_type_list[i]); |
302 } | 302 } |
303 }; | 303 }; |
OLD | NEW |