| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 base::Bind(&MediaPlayer::PopupMediaPlayer, | 127 base::Bind(&MediaPlayer::PopupMediaPlayer, |
| 128 base::Unretained(this), // this class is a singleton. | 128 base::Unretained(this), // this class is a singleton. |
| 129 static_cast<Browser*>(NULL))); | 129 static_cast<Browser*>(NULL))); |
| 130 return; | 130 return; |
| 131 } | 131 } |
| 132 if (mediaplayer_browser_) { // Already opened. | 132 if (mediaplayer_browser_) { // Already opened. |
| 133 mediaplayer_browser_->window()->Show(); | 133 mediaplayer_browser_->window()->Show(); |
| 134 return; | 134 return; |
| 135 } | 135 } |
| 136 | 136 |
| 137 const gfx::Size screen = gfx::Screen::GetPrimaryMonitorSize(); | 137 const gfx::Size screen = gfx::Screen::GetPrimaryMonitorBounds().size(); |
| 138 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, | 138 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, |
| 139 screen.height() - kPopupBottom - kPopupHeight, | 139 screen.height() - kPopupBottom - kPopupHeight, |
| 140 kPopupWidth, | 140 kPopupWidth, |
| 141 kPopupHeight); | 141 kPopupHeight); |
| 142 | 142 |
| 143 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 143 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
| 144 mediaplayer_browser_ = Browser::CreateWithParams( | 144 mediaplayer_browser_ = Browser::CreateWithParams( |
| 145 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, | 145 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, |
| 146 kMediaPlayerAppName, | 146 kMediaPlayerAppName, |
| 147 bounds, | 147 bounds, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 GURL MediaPlayer::GetMediaPlayerUrl() const { | 162 GURL MediaPlayer::GetMediaPlayerUrl() const { |
| 163 return file_manager_util::GetMediaPlayerUrl(); | 163 return file_manager_util::GetMediaPlayerUrl(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 MediaPlayer::MediaPlayer() | 166 MediaPlayer::MediaPlayer() |
| 167 : current_position_(0), | 167 : current_position_(0), |
| 168 mediaplayer_browser_(NULL) { | 168 mediaplayer_browser_(NULL) { |
| 169 }; | 169 }; |
| OLD | NEW |