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 "base/bind.h" | 9 #include "base/bind.h" |
10 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 10 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
128 const gfx::Size screen = gfx::Screen::GetPrimaryDisplay().size(); | 128 const gfx::Size screen = gfx::Screen::GetPrimaryDisplay().size(); |
129 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, | 129 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, |
130 screen.height() - kPopupBottom - kPopupHeight, | 130 screen.height() - kPopupBottom - kPopupHeight, |
131 kPopupWidth, | 131 kPopupWidth, |
132 kPopupHeight); | 132 kPopupHeight); |
133 | 133 |
134 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 134 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
135 mediaplayer_browser_ = Browser::CreateWithParams( | 135 mediaplayer_browser_ = new Browser( |
136 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, | 136 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, |
137 kMediaPlayerAppName, | 137 kMediaPlayerAppName, |
138 bounds, | 138 bounds, |
139 profile)); | 139 profile)); |
140 registrar_.Add(this, | 140 registrar_.Add(this, |
141 chrome::NOTIFICATION_BROWSER_CLOSED, | 141 chrome::NOTIFICATION_BROWSER_CLOSED, |
142 content::Source<Browser>(mediaplayer_browser_)); | 142 content::Source<Browser>(mediaplayer_browser_)); |
143 | 143 |
144 chrome::AddSelectedTabWithURL(mediaplayer_browser_, GetMediaPlayerUrl(), | 144 chrome::AddSelectedTabWithURL(mediaplayer_browser_, GetMediaPlayerUrl(), |
145 content::PAGE_TRANSITION_LINK); | 145 content::PAGE_TRANSITION_LINK); |
146 mediaplayer_browser_->window()->Show(); | 146 mediaplayer_browser_->window()->Show(); |
147 } | 147 } |
148 | 148 |
149 GURL MediaPlayer::GetMediaPlayerUrl() const { | 149 GURL MediaPlayer::GetMediaPlayerUrl() const { |
150 return file_manager_util::GetMediaPlayerUrl(); | 150 return file_manager_util::GetMediaPlayerUrl(); |
151 } | 151 } |
152 | 152 |
153 MediaPlayer::MediaPlayer() | 153 MediaPlayer::MediaPlayer() |
154 : current_position_(0), | 154 : current_position_(0), |
155 mediaplayer_browser_(NULL) { | 155 mediaplayer_browser_(NULL) { |
156 }; | 156 }; |
OLD | NEW |