Chromium Code Reviews| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 GetOriginUrl(), &url)) { | 111 GetOriginUrl(), &url)) { |
| 112 return; | 112 return; |
| 113 } | 113 } |
| 114 ForcePlayMediaURL(url, creator); | 114 ForcePlayMediaURL(url, creator); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void MediaPlayer::ForcePlayMediaURL(const GURL& url, Browser* creator) { | 117 void MediaPlayer::ForcePlayMediaURL(const GURL& url, Browser* creator) { |
| 118 if (mediaplayer_browser_ == NULL) { | 118 if (mediaplayer_browser_ == NULL) { |
| 119 PopupMediaPlayer(creator); | 119 PopupMediaPlayer(creator); |
| 120 } | 120 } |
| 121 current_playlist_.clear(); | |
|
Vladislav Kaznacheev
2011/08/10 13:34:58
This seriously changes the behavior. Does the bug
SeRya
2011/08/10 15:51:00
This change solves a separate problems and I filed
| |
| 121 current_playlist_.push_back(MediaUrl(url)); | 122 current_playlist_.push_back(MediaUrl(url)); |
| 122 current_position_ = current_playlist_.size() - 1; | 123 current_position_ = current_playlist_.size() - 1; |
| 123 pending_playback_request_ = true; | 124 pending_playback_request_ = true; |
| 124 NotifyPlaylistChanged(); | 125 NotifyPlaylistChanged(); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void MediaPlayer::TogglePlaylistWindowVisible() { | 128 void MediaPlayer::TogglePlaylistWindowVisible() { |
| 128 if (playlist_browser_) { | 129 if (playlist_browser_) { |
| 129 ClosePlaylistWindow(); | 130 ClosePlaylistWindow(); |
| 130 } else { | 131 } else { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 | 304 |
| 304 MediaPlayer::MediaPlayer() | 305 MediaPlayer::MediaPlayer() |
| 305 : current_position_(0), | 306 : current_position_(0), |
| 306 pending_playback_request_(false), | 307 pending_playback_request_(false), |
| 307 playlist_browser_(NULL), | 308 playlist_browser_(NULL), |
| 308 mediaplayer_browser_(NULL) { | 309 mediaplayer_browser_(NULL) { |
| 309 for (size_t i = 0; i < arraysize(supported_mime_type_list); ++i) { | 310 for (size_t i = 0; i < arraysize(supported_mime_type_list); ++i) { |
| 310 supported_mime_types_.insert(supported_mime_type_list[i]); | 311 supported_mime_types_.insert(supported_mime_type_list[i]); |
| 311 } | 312 } |
| 312 }; | 313 }; |
| OLD | NEW |