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

Unified Diff: chrome/browser/chromeos/media/media_player.cc

Issue 9353010: Add FullscreenController::ToggleFullscreenModeWithExtension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Show "An extension triggered full screen." when the extension's name is not available. Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker_browsertest.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/media/media_player.cc
diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc
index 5fbe6ee553eb7a0bab533f71a91f5ee6d2045183..c84e6a0a507ba2979df08b8c140a1c7308c3690b 100644
--- a/chrome/browser/chromeos/media/media_player.cc
+++ b/chrome/browser/chromeos/media/media_player.cc
@@ -85,9 +85,8 @@ MediaPlayer* MediaPlayer::GetInstance() {
void MediaPlayer::EnqueueMediaFile(Profile* profile,
const FilePath& file_path) {
GURL url;
- if (!file_manager_util::ConvertFileToFileSystemUrl(profile, file_path,
- GetOriginUrl(), &url)) {
- }
+ file_manager_util::ConvertFileToFileSystemUrl(profile, file_path,
+ GetOriginUrl(), &url);
EnqueueMediaFileUrl(url);
}
@@ -100,9 +99,8 @@ void MediaPlayer::ForcePlayMediaFile(Profile* profile,
const FilePath& file_path) {
GURL url;
if (!file_manager_util::ConvertFileToFileSystemUrl(profile, file_path,
- GetOriginUrl(), &url)) {
+ GetOriginUrl(), &url))
return;
- }
ForcePlayMediaURL(url);
}
@@ -115,17 +113,15 @@ void MediaPlayer::ForcePlayMediaURL(const GURL& url) {
}
void MediaPlayer::TogglePlaylistWindowVisible() {
- if (playlist_browser_) {
+ if (playlist_browser_)
ClosePlaylistWindow();
- } else {
+ else
PopupPlaylist(NULL);
- }
}
void MediaPlayer::ClosePlaylistWindow() {
- if (playlist_browser_ != NULL) {
+ if (playlist_browser_ != NULL)
playlist_browser_->window()->Close();
- }
}
void MediaPlayer::SetPlaylistPosition(int position) {
@@ -140,9 +136,8 @@ void MediaPlayer::SetPlaylistPosition(int position) {
void MediaPlayer::SetPlaybackError(GURL const& url) {
for (size_t x = 0; x < current_playlist_.size(); x++) {
- if (current_playlist_[x].url == url) {
+ if (current_playlist_[x].url == url)
current_playlist_[x].haderror = true;
- }
}
NotifyPlaylistChanged();
}
@@ -151,14 +146,12 @@ void MediaPlayer::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK(type == chrome::NOTIFICATION_BROWSER_CLOSED);
- registrar_.Remove(this,
- chrome::NOTIFICATION_BROWSER_CLOSED,
- source);
- if (content::Source<Browser>(source).ptr() == mediaplayer_browser_) {
+ registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_CLOSED, source);
+
+ if (content::Source<Browser>(source).ptr() == mediaplayer_browser_)
mediaplayer_browser_ = NULL;
- } else if (content::Source<Browser>(source).ptr() == playlist_browser_) {
+ else if (content::Source<Browser>(source).ptr() == playlist_browser_)
playlist_browser_ = NULL;
- }
}
void MediaPlayer::NotifyPlaylistChanged() {
@@ -176,9 +169,8 @@ void MediaPlayer::SetPlaybackRequest() {
}
void MediaPlayer::ToggleFullscreen() {
- if (mediaplayer_browser_) {
- mediaplayer_browser_->ToggleFullscreenMode(false);
- }
+ if (mediaplayer_browser_)
+ mediaplayer_browser_->ToggleFullscreenMode();
}
void MediaPlayer::PopupPlaylist(Browser* creator) {
@@ -261,9 +253,8 @@ static const char* const supported_mime_type_list[] = {
net::URLRequestJob* MediaPlayer::MaybeInterceptResponse(
net::URLRequest* request) {
// Do not intercept this request if it is a download.
- if (request->load_flags() & net::LOAD_IS_DOWNLOAD) {
+ if (request->load_flags() & net::LOAD_IS_DOWNLOAD)
return NULL;
- }
std::string mime_type;
request->GetMimeType(&mime_type);
« no previous file with comments | « chrome/browser/chromeos/login/screen_locker_browsertest.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698