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/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "content/common/content_notification_types.h" |
13 #include "content/common/notification_observer.h" | 14 #include "content/common/notification_observer.h" |
14 #include "content/common/notification_registrar.h" | 15 #include "content/common/notification_registrar.h" |
15 #include "content/common/notification_source.h" | 16 #include "content/common/notification_source.h" |
16 #include "content/common/notification_type.h" | |
17 | 17 |
18 #include "net/url_request/url_request.h" | 18 #include "net/url_request/url_request.h" |
19 | 19 |
20 template <typename T> struct DefaultSingletonTraits; | 20 template <typename T> struct DefaultSingletonTraits; |
21 | 21 |
22 class Browser; | 22 class Browser; |
23 class GURL; | 23 class GURL; |
24 class Profile; | 24 class Profile; |
25 | 25 |
26 class MediaPlayer : public NotificationObserver, | 26 class MediaPlayer : public NotificationObserver, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Implementation of net::URLRequest::Interceptor. | 90 // Implementation of net::URLRequest::Interceptor. |
91 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); | 91 virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); |
92 | 92 |
93 // Determines if the requested document can be viewed by the | 93 // Determines if the requested document can be viewed by the |
94 // MediaPlayer. If it can, returns a net::URLRequestJob that | 94 // MediaPlayer. If it can, returns a net::URLRequestJob that |
95 // redirects the browser to the view URL. | 95 // redirects the browser to the view URL. |
96 // Implementation of net::URLRequest::Interceptor. | 96 // Implementation of net::URLRequest::Interceptor. |
97 virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); | 97 virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); |
98 | 98 |
99 // Used to detect when the mediaplayer is closed. | 99 // Used to detect when the mediaplayer is closed. |
100 virtual void Observe(NotificationType type, | 100 virtual void Observe(int type, |
101 const NotificationSource& source, | 101 const NotificationSource& source, |
102 const NotificationDetails& details); | 102 const NotificationDetails& details); |
103 | 103 |
104 // Getter for the singleton. | 104 // Getter for the singleton. |
105 static MediaPlayer* GetInstance(); | 105 static MediaPlayer* GetInstance(); |
106 | 106 |
107 private: | 107 private: |
108 friend struct DefaultSingletonTraits<MediaPlayer>; | 108 friend struct DefaultSingletonTraits<MediaPlayer>; |
109 | 109 |
110 // The current playlist of urls. | 110 // The current playlist of urls. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 struct MediaPlayer::MediaUrl { | 152 struct MediaPlayer::MediaUrl { |
153 MediaUrl() {} | 153 MediaUrl() {} |
154 explicit MediaUrl(const GURL& newurl) | 154 explicit MediaUrl(const GURL& newurl) |
155 : url(newurl), | 155 : url(newurl), |
156 haderror(false) {} | 156 haderror(false) {} |
157 GURL url; | 157 GURL url; |
158 bool haderror; | 158 bool haderror; |
159 }; | 159 }; |
160 | 160 |
161 #endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ | 161 #endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_H_ |
OLD | NEW |