Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / chrome / renderer / prerender / prerender_media_load_deferrer.h
blob2c783892e34e26eca9188977c2ed94e3fda3281a
1 // Copyright 2013 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.
5 #ifndef CHROME_RENDERER_PRERENDER_PRERENDER_MEDIA_LOAD_DEFERRER_H_
6 #define CHROME_RENDERER_PRERENDER_PRERENDER_MEDIA_LOAD_DEFERRER_H_
8 #include "base/callback.h"
9 #include "content/public/renderer/render_frame_observer.h"
11 namespace prerender {
13 // Defers media player loading in prerendered pages until the prerendered page
14 // is swapped in.
15 class PrerenderMediaLoadDeferrer : public content::RenderFrameObserver {
16 public:
17 // Will run |closure| to continue loading the media resource once the page is
18 // swapped in.
19 PrerenderMediaLoadDeferrer(content::RenderFrame* render_frame,
20 const base::Closure& closure);
21 ~PrerenderMediaLoadDeferrer() override;
23 private:
24 // RenderFrameObserver method:
25 bool OnMessageReceived(const IPC::Message& message) override;
27 void OnSetIsPrerendering(bool is_prerendering);
29 bool is_prerendering_;
30 base::Closure continue_loading_cb_;
32 DISALLOW_COPY_AND_ASSIGN(PrerenderMediaLoadDeferrer);
35 } // namespace prerender
37 #endif // CHROME_RENDERER_PRERENDER_PRERENDER_MEDIA_LOAD_DEFERRER_H_