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

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

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 };
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/enrollment_dialog_view.cc ('k') | chrome/browser/debugger/devtools_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698