OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 GURL MediaPlayer::GetMediaPlayerUrl() { | 153 GURL MediaPlayer::GetMediaPlayerUrl() { |
154 return file_manager_util::GetMediaPlayerUrl(); | 154 return file_manager_util::GetMediaPlayerUrl(); |
155 } | 155 } |
156 | 156 |
157 Browser* MediaPlayer::GetBrowser() { | 157 Browser* MediaPlayer::GetBrowser() { |
158 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 158 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
159 Browser* browser = *it; | 159 Browser* browser = *it; |
160 TabStripModel* tab_strip = browser->tab_strip_model(); | 160 TabStripModel* tab_strip = browser->tab_strip_model(); |
161 for (int idx = 0; idx < tab_strip->count(); idx++) { | 161 for (int idx = 0; idx < tab_strip->count(); idx++) { |
162 const GURL& url = tab_strip->GetWebContentsAt(idx)->GetURL(); | 162 const GURL& url = tab_strip->GetWebContentsAt(idx)->GetVisibleURL(); |
163 GURL base_url(url.GetOrigin().spec() + url.path().substr(1)); | 163 GURL base_url(url.GetOrigin().spec() + url.path().substr(1)); |
164 if (base_url == GetMediaPlayerUrl()) | 164 if (base_url == GetMediaPlayerUrl()) |
165 return browser; | 165 return browser; |
166 } | 166 } |
167 } | 167 } |
168 return NULL; | 168 return NULL; |
169 } | 169 } |
170 | 170 |
171 MediaPlayer::MediaPlayer() | 171 MediaPlayer::MediaPlayer() |
172 : current_position_(0) { | 172 : current_position_(0) { |
173 }; | 173 }; |
OLD | NEW |