Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1627)

Side by Side Diff: chrome/browser/chromeos/media/media_player.cc

Issue 19869003: ChromeOS changes for GetURL refactor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing failing tests. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698