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

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

Issue 11416013: Move RequestPpapiBrokerPermission from WebContentsObserver to WebContentsDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android Created 8 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 | Annotate | Revision Log
OLDNEW
(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_BROWSER_PEPPER_BROKER_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_PEPPER_BROKER_INFOBAR_DELEGATE_H_
7
8 #include "base/callback.h"
9 #include "base/file_path.h"
10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
11 #include "googleurl/src/gurl.h"
12
13 class HostContentSettingsMap;
14 class InfoBarTabHelper;
15
16 namespace content {
17 class WebContents;
18 }
19
20 // Shows an infobar that asks the user whether a Pepper plug-in is allowed
21 // to connect to its (privileged) broker. The user decision is made "sticky"
22 // by storing a content setting for the site.
23 class PepperBrokerInfoBarDelegate : public ConfirmInfoBarDelegate {
24 public:
25 virtual ~PepperBrokerInfoBarDelegate();
26
27 static void Show(
28 content::WebContents* web_contents,
29 const GURL& url,
30 const FilePath& plugin_path,
31 const base::Callback<void(bool)>& callback);
32
33 // ConfirmInfoBarDelegate:
34 virtual string16 GetMessageText() const OVERRIDE;
35 virtual int GetButtons() const OVERRIDE;
36 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
37 virtual bool Accept() OVERRIDE;
38 virtual bool Cancel() OVERRIDE;
39 virtual string16 GetLinkText() const OVERRIDE;
40 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
41 virtual gfx::Image* GetIcon() const OVERRIDE;
42
43 private:
44 PepperBrokerInfoBarDelegate(
45 InfoBarTabHelper* helper,
46 const GURL& url,
47 const FilePath& plugin_path,
48 const std::string& languages,
49 HostContentSettingsMap* content_settings,
50 const base::Callback<void(bool)>& callback);
51
52 void DispatchCallback(bool result);
53
54 const GURL url_;
55 const FilePath plugin_path_;
56 const std::string languages_;
57 HostContentSettingsMap* content_settings_;
58 base::Callback<void(bool)> callback_;
59
60 DISALLOW_COPY_AND_ASSIGN(PepperBrokerInfoBarDelegate);
61 };
62
63 #endif // CHROME_BROWSER_PEPPER_BROKER_INFOBAR_DELEGATE_H_
OLDNEW
« no previous file with comments | « android_webview/browser/renderer_host/aw_render_view_host_ext.h ('k') | chrome/browser/pepper_broker_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698