| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_RENDERER_PRERENDER_PRERENDER_WEBMEDIAPLAYER_H_ | |
| 6 #define CHROME_RENDERER_PRERENDER_PRERENDER_WEBMEDIAPLAYER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "content/public/renderer/render_view_observer.h" | |
| 10 | |
| 11 namespace prerender { | |
| 12 | |
| 13 // Defers media player loading in prerendered pages until the prerendered page | |
| 14 // is swapped in. | |
| 15 // | |
| 16 // TODO(scherkus): Rename as this class no longer inherits WebMediaPlayer. | |
| 17 class PrerenderWebMediaPlayer : public content::RenderViewObserver { | |
| 18 public: | |
| 19 // Will run |closure| to continue loading the media resource once the page is | |
| 20 // swapped in. | |
| 21 PrerenderWebMediaPlayer(content::RenderView* render_view, | |
| 22 const base::Closure& closure); | |
| 23 virtual ~PrerenderWebMediaPlayer(); | |
| 24 | |
| 25 private: | |
| 26 // RenderViewObserver method: | |
| 27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 28 | |
| 29 void OnSetIsPrerendering(bool is_prerendering); | |
| 30 | |
| 31 bool is_prerendering_; | |
| 32 base::Closure continue_loading_cb_; | |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(PrerenderWebMediaPlayer); | |
| 35 }; | |
| 36 | |
| 37 } // namespace prerender | |
| 38 | |
| 39 #endif // CHROME_RENDERER_PRERENDER_PRERENDER_WEBMEDIAPLAYER_H_ | |
| OLD | NEW |