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

Side by Side Diff: content/browser/plugin_content_origin_whitelist.h

Issue 680193002: Plugin Power Saver: Implement size-based heuristic for peripheral content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/plugin_content_origin_whitelist.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 CONTENT_BROWSER_PLUGIN_CONTENT_ORIGIN_WHITELIST_H_
6 #define CONTENT_BROWSER_PLUGIN_CONTENT_ORIGIN_WHITELIST_H_
7
8 #include <set>
9
10 #include "content/public/browser/web_contents_observer.h"
11 #include "url/gurl.h"
12
13 namespace content {
14
15 class WebContents;
16
17 // This class manages the tab-wide list of temporarily whitelisted plugin
18 // content origins that are exempt from power saving.
19 //
20 // RenderFrames report content origins that should be whitelisted via IPC.
21 // This class aggregates those origins and broadcasts the total list to all
22 // RenderFrames owned by the tab (WebContents). This class also sends these
23 // origins to any newly created RenderFrames.
24 //
25 // Tab-wide whitelists are cleared by top-level navigation. RenderFrames that
26 // persist across top level navigations are responsible for clearing their own
27 // whitelists.
28 class PluginContentOriginWhitelist : public WebContentsObserver {
29 public:
30 explicit PluginContentOriginWhitelist(WebContents* web_contents);
31 ~PluginContentOriginWhitelist() override;
32
33 private:
34 // WebContentsObserver implementation.
35 void RenderFrameCreated(RenderFrameHost* render_frame_host) override;
36 bool OnMessageReceived(const IPC::Message& message,
37 RenderFrameHost* render_frame_host) override;
38 void DidNavigateMainFrame(
39 const LoadCommittedDetails& details,
40 const FrameNavigateParams& params) override;
41
42 void OnPluginContentOriginAllowed(const GURL& content_origin);
43
44 std::set<GURL> whitelist_;
45
46 DISALLOW_COPY_AND_ASSIGN(PluginContentOriginWhitelist);
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_BROWSER_PLUGIN_CONTENT_ORIGIN_WHITELIST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/plugin_content_origin_whitelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698