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

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

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix command line Created 8 years, 8 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 "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"
11 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" 11 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
14 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_list.h" 15 #include "chrome/browser/ui/browser_list.h"
16 #include "chrome/browser/ui/browser_window.h" 16 #include "chrome/browser/ui/browser_window.h"
17 #include "chrome/common/chrome_notification_types.h" 17 #include "chrome/common/chrome_notification_types.h"
18 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
19 #include "content/public/browser/user_metrics.h" 19 #include "content/public/browser/user_metrics.h"
20 #include "net/url_request/url_request_job.h" 20 #include "net/url_request/url_request_job.h"
21 #include "ui/gfx/monitor.h"
21 #include "ui/gfx/screen.h" 22 #include "ui/gfx/screen.h"
22 23
23 using content::BrowserThread; 24 using content::BrowserThread;
24 using content::UserMetricsAction; 25 using content::UserMetricsAction;
25 26
26 static const char* kMediaPlayerAppName = "mediaplayer"; 27 static const char* kMediaPlayerAppName = "mediaplayer";
27 static const int kPopupRight = 20; 28 static const int kPopupRight = 20;
28 static const int kPopupBottom = 50; 29 static const int kPopupBottom = 50;
29 static const int kPopupWidth = 280; 30 static const int kPopupWidth = 280;
30 31
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 base::Bind(&MediaPlayer::PopupMediaPlayer, 128 base::Bind(&MediaPlayer::PopupMediaPlayer,
128 base::Unretained(this), // this class is a singleton. 129 base::Unretained(this), // this class is a singleton.
129 static_cast<Browser*>(NULL))); 130 static_cast<Browser*>(NULL)));
130 return; 131 return;
131 } 132 }
132 if (mediaplayer_browser_) { // Already opened. 133 if (mediaplayer_browser_) { // Already opened.
133 mediaplayer_browser_->window()->Show(); 134 mediaplayer_browser_->window()->Show();
134 return; 135 return;
135 } 136 }
136 137
137 const gfx::Size screen = gfx::Screen::GetPrimaryMonitorSize(); 138 const gfx::Size screen = gfx::Screen::GetPrimaryMonitor()->GetSize();
138 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth, 139 const gfx::Rect bounds(screen.width() - kPopupRight - kPopupWidth,
139 screen.height() - kPopupBottom - kPopupHeight, 140 screen.height() - kPopupBottom - kPopupHeight,
140 kPopupWidth, 141 kPopupWidth,
141 kPopupHeight); 142 kPopupHeight);
142 143
143 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); 144 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
144 mediaplayer_browser_ = Browser::CreateWithParams( 145 mediaplayer_browser_ = Browser::CreateWithParams(
145 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL, 146 Browser::CreateParams::CreateForApp(Browser::TYPE_PANEL,
146 kMediaPlayerAppName, 147 kMediaPlayerAppName,
147 bounds, 148 bounds,
(...skipping 12 matching lines...) Expand all
160 } 161 }
161 162
162 GURL MediaPlayer::GetMediaPlayerUrl() const { 163 GURL MediaPlayer::GetMediaPlayerUrl() const {
163 return file_manager_util::GetMediaPlayerUrl(); 164 return file_manager_util::GetMediaPlayerUrl();
164 } 165 }
165 166
166 MediaPlayer::MediaPlayer() 167 MediaPlayer::MediaPlayer()
167 : current_position_(0), 168 : current_position_(0),
168 mediaplayer_browser_(NULL) { 169 mediaplayer_browser_(NULL) {
169 }; 170 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698