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

Side by Side Diff: chrome/browser/pepper_flash_settings_manager.h

Issue 10391173: Pepper Flash settings integration: implement "deauthorize content licenses". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_PEPPER_FLASH_SETTINGS_MANAGER_H_ 5 #ifndef CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_
6 #define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ 6 #define CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h"
10 11
11 class PluginPrefs; 12 class PluginPrefs;
12 class PrefService; 13 class PrefService;
13 14
15 namespace content {
16 class BrowserContext;
17 }
18
14 namespace webkit { 19 namespace webkit {
15 struct WebPluginInfo; 20 struct WebPluginInfo;
16 } 21 }
17 22
18 // PepperFlashSettingsManager communicates with a PPAPI broker process to 23 // PepperFlashSettingsManager communicates with a PPAPI broker process to
19 // read/write Pepper Flash settings. 24 // read/write Pepper Flash settings.
20 class PepperFlashSettingsManager { 25 class PepperFlashSettingsManager {
21 public: 26 public:
27 class Client {
28 public:
29 virtual ~Client() {}
30
31 virtual void OnDeauthorizeContentLicensesCompleted(uint32 request_id,
32 bool success) = 0;
33 };
34
35 // |client| must outlive this object. It is guaranteed that |client| won't
36 // receive any notifications after this object goes away.
37 PepperFlashSettingsManager(Client* client,
38 content::BrowserContext* browser_context);
39 ~PepperFlashSettingsManager();
40
22 // |plugin_info| will be updated if it is not NULL and the method returns 41 // |plugin_info| will be updated if it is not NULL and the method returns
23 // true. 42 // true.
24 static bool IsPepperFlashInUse(PluginPrefs* plugin_prefs, 43 static bool IsPepperFlashInUse(PluginPrefs* plugin_prefs,
25 webkit::WebPluginInfo* plugin_info); 44 webkit::WebPluginInfo* plugin_info);
26 45
27 static void RegisterUserPrefs(PrefService* prefs); 46 static void RegisterUserPrefs(PrefService* prefs);
28 47
48 // Requests to deauthorize content licenses.
49 // Client::OnDeauthorizeContentLicensesCompleted() will be called when the
50 // operation is completed.
51 // The return value is the same as the request ID passed into
52 // Client::OnDeauthorizeContentLicensesCompleted().
53 uint32 DeauthorizeContentLicenses();
54
29 private: 55 private:
30 DISALLOW_IMPLICIT_CONSTRUCTORS(PepperFlashSettingsManager); 56 // Core does most of the work. It is ref-counted so that its lifespan can be
57 // independent of the containing object's:
58 // - The manager can be deleted on the UI thread while the core still being
59 // used on the I/O thread.
60 // - The manager can delete the core when it encounters errors and create
61 // another one to handle new requests.
62 class Core;
63
64 uint32 GetNextRequestId();
65
66 void EnsureCoreExists();
67
68 // Notified by |core_| when an error occurs.
69 void OnError();
70
71 // |client_| is not owned by this object and must outlive it.
72 Client* client_;
73
74 // The browser context for the profile.
75 content::BrowserContext* browser_context_;
76
77 scoped_refptr<Core> core_;
78
79 uint32 next_request_id_;
80
81 DISALLOW_COPY_AND_ASSIGN(PepperFlashSettingsManager);
31 }; 82 };
32 83
33 #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_ 84 #endif // CHROME_BROWSER_PEPPER_FLASH_SETTINGS_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data_remover.cc ('k') | chrome/browser/pepper_flash_settings_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698