| 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 "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 11 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
| 11 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 12 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "chrome/browser/ui/browser_tabstrip.h" | 18 #include "chrome/browser/ui/browser_tabstrip.h" |
| 18 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 113 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 113 BrowserThread::PostTask( | 114 BrowserThread::PostTask( |
| 114 BrowserThread::UI, FROM_HERE, | 115 BrowserThread::UI, FROM_HERE, |
| 115 base::Bind(&MediaPlayer::PopupMediaPlayer, | 116 base::Bind(&MediaPlayer::PopupMediaPlayer, |
| 116 base::Unretained(this) /*this class is a singleton*/)); | 117 base::Unretained(this) /*this class is a singleton*/)); |
| 117 return; | 118 return; |
| 118 } | 119 } |
| 119 | 120 |
| 120 Browser* browser = GetBrowser(); | 121 Browser* browser = GetBrowser(); |
| 121 if (!browser) { | 122 if (!browser) { |
| 122 const gfx::Size screen = gfx::Screen::GetPrimaryDisplay().size(); | 123 const gfx::Size screen = |
| 124 ash::Shell::GetAshScreen()->GetPrimaryDisplay().size(); |
| 123 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, | 125 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, |
| 124 screen.height() - kPopupBottom - kPopupHeight, | 126 screen.height() - kPopupBottom - kPopupHeight, |
| 125 kPopupWidth, | 127 kPopupWidth, |
| 126 kPopupHeight); | 128 kPopupHeight); |
| 127 | 129 |
| 128 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 130 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
| 129 browser = new Browser( | 131 browser = new Browser( |
| 130 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, | 132 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, |
| 131 kMediaPlayerAppName, | 133 kMediaPlayerAppName, |
| 132 bounds, | 134 bounds, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 155 if (base_url == GetMediaPlayerUrl()) | 157 if (base_url == GetMediaPlayerUrl()) |
| 156 return browser; | 158 return browser; |
| 157 } | 159 } |
| 158 } | 160 } |
| 159 return NULL; | 161 return NULL; |
| 160 } | 162 } |
| 161 | 163 |
| 162 MediaPlayer::MediaPlayer() | 164 MediaPlayer::MediaPlayer() |
| 163 : current_position_(0) { | 165 : current_position_(0) { |
| 164 }; | 166 }; |
| OLD | NEW |