OLD | NEW |
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_BROKER_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PEPPER_BROKER_OBSERVER_H_ |
6 #define CHROME_BROWSER_PEPPER_BROKER_OBSERVER_H_ | 6 #define CHROME_BROWSER_PEPPER_BROKER_OBSERVER_H_ |
7 | 7 |
8 #include "chrome/browser/common/web_contents_user_data.h" | 8 #include "chrome/browser/common/web_contents_user_data.h" |
9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
10 | 10 |
11 class PepperBrokerObserver : public content::WebContentsObserver, | 11 class PepperBrokerObserver : public content::WebContentsObserver, |
12 public WebContentsUserData<PepperBrokerObserver> { | 12 public WebContentsUserData<PepperBrokerObserver> { |
13 public: | 13 public: |
14 virtual ~PepperBrokerObserver(); | 14 virtual ~PepperBrokerObserver(); |
15 | 15 |
16 private: | 16 private: |
17 explicit PepperBrokerObserver(content::WebContents* web_contents); | 17 explicit PepperBrokerObserver(content::WebContents* web_contents); |
18 static int kUserDataKey; | |
19 friend class WebContentsUserData<PepperBrokerObserver>; | 18 friend class WebContentsUserData<PepperBrokerObserver>; |
20 | 19 |
21 virtual bool RequestPpapiBrokerPermission( | 20 virtual bool RequestPpapiBrokerPermission( |
22 content::WebContents* web_contents, | 21 content::WebContents* web_contents, |
23 const GURL& url, | 22 const GURL& url, |
24 const FilePath& plugin_path, | 23 const FilePath& plugin_path, |
25 const base::Callback<void(bool)>& callback) OVERRIDE; | 24 const base::Callback<void(bool)>& callback) OVERRIDE; |
26 | 25 |
27 DISALLOW_COPY_AND_ASSIGN(PepperBrokerObserver); | 26 DISALLOW_COPY_AND_ASSIGN(PepperBrokerObserver); |
28 }; | 27 }; |
29 | 28 |
30 #endif // CHROME_BROWSER_PEPPER_BROKER_OBSERVER_H_ | 29 #endif // CHROME_BROWSER_PEPPER_BROKER_OBSERVER_H_ |
OLD | NEW |