OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/compiler_specific.h" |
12 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
13 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
14 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
15 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
16 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
17 #include "net/url_request/url_request.h" | 18 #include "net/url_request/url_request.h" |
18 | 19 |
19 template <typename T> struct DefaultSingletonTraits; | 20 template <typename T> struct DefaultSingletonTraits; |
20 | 21 |
21 class Browser; | 22 class Browser; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Retuen true if playback requested. Resets this flag. | 80 // Retuen true if playback requested. Resets this flag. |
80 bool GetPendingPlayRequestAndReset(); | 81 bool GetPendingPlayRequestAndReset(); |
81 | 82 |
82 // Requests starting playback of the current playlist item when the | 83 // Requests starting playback of the current playlist item when the |
83 // mediaplayer get the playlist updated. | 84 // mediaplayer get the playlist updated. |
84 void SetPlaybackRequest(); | 85 void SetPlaybackRequest(); |
85 | 86 |
86 // Always returns NULL because we don't want to attempt a redirect | 87 // Always returns NULL because we don't want to attempt a redirect |
87 // before seeing the detected mime type of the request. | 88 // before seeing the detected mime type of the request. |
88 // Implementation of net::URLRequest::Interceptor. | 89 // Implementation of net::URLRequest::Interceptor. |
89 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); | 90 virtual net::URLRequestJob* MaybeIntercept( |
| 91 net::URLRequest* request) OVERRIDE; |
90 | 92 |
91 // Determines if the requested document can be viewed by the | 93 // Determines if the requested document can be viewed by the |
92 // MediaPlayer. If it can, returns a net::URLRequestJob that | 94 // MediaPlayer. If it can, returns a net::URLRequestJob that |
93 // redirects the browser to the view URL. | 95 // redirects the browser to the view URL. |
94 // Implementation of net::URLRequest::Interceptor. | 96 // Implementation of net::URLRequest::Interceptor. |
95 virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); | 97 virtual net::URLRequestJob* MaybeInterceptResponse( |
| 98 net::URLRequest* request) OVERRIDE; |
96 | 99 |
97 // Used to detect when the mediaplayer is closed. | 100 // Used to detect when the mediaplayer is closed. |
98 virtual void Observe(int type, | 101 virtual void Observe(int type, |
99 const content::NotificationSource& source, | 102 const content::NotificationSource& source, |
100 const content::NotificationDetails& details); | 103 const content::NotificationDetails& details) OVERRIDE; |
101 | 104 |
102 // Getter for the singleton. | 105 // Getter for the singleton. |
103 static MediaPlayer* GetInstance(); | 106 static MediaPlayer* GetInstance(); |
104 | 107 |
105 private: | 108 private: |
106 friend struct DefaultSingletonTraits<MediaPlayer>; | 109 friend struct DefaultSingletonTraits<MediaPlayer>; |
107 | 110 |
108 // The current playlist of urls. | 111 // The current playlist of urls. |
109 UrlVector current_playlist_; | 112 UrlVector current_playlist_; |
110 // The position into the current_playlist_ of the currently playing item. | 113 // The position into the current_playlist_ of the currently playing item. |
(...skipping 29 matching lines...) Expand all Loading... |
140 struct MediaPlayer::MediaUrl { | 143 struct MediaPlayer::MediaUrl { |
141 MediaUrl() {} | 144 MediaUrl() {} |
142 explicit MediaUrl(const GURL& newurl) | 145 explicit MediaUrl(const GURL& newurl) |
143 : url(newurl), | 146 : url(newurl), |
144 haderror(false) {} | 147 haderror(false) {} |
145 GURL url; | 148 GURL url; |
146 bool haderror; | 149 bool haderror; |
147 }; | 150 }; |
148 | 151 |
149 #endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ | 152 #endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ |
OLD | NEW |