OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_OBSERVER_H_ |
6 #define CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_OBSERVER_H_ | 6 #define CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_OBSERVER_H_ |
7 | 7 |
| 8 #include "chrome/browser/tab_contents/web_contents_user_data.h" |
8 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
9 | 10 |
10 // ExternalProtocolObserver is responsible for handling messages from | 11 // ExternalProtocolObserver is responsible for handling messages from |
11 // WebContents relating to external protocols. | 12 // WebContents relating to external protocols. |
12 class ExternalProtocolObserver : public content::WebContentsObserver { | 13 class ExternalProtocolObserver |
| 14 : public content::WebContentsObserver, |
| 15 public WebContentsUserData<ExternalProtocolObserver> { |
13 public: | 16 public: |
14 explicit ExternalProtocolObserver(content::WebContents* web_contents); | |
15 virtual ~ExternalProtocolObserver(); | 17 virtual ~ExternalProtocolObserver(); |
16 | 18 |
17 // content::WebContentsObserver overrides. | 19 // content::WebContentsObserver overrides. |
18 virtual void DidGetUserGesture() OVERRIDE; | 20 virtual void DidGetUserGesture() OVERRIDE; |
19 | 21 |
20 private: | 22 private: |
| 23 explicit ExternalProtocolObserver(content::WebContents* web_contents); |
| 24 static int kUserDataKey; |
| 25 friend class WebContentsUserData<ExternalProtocolObserver>; |
| 26 |
21 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolObserver); | 27 DISALLOW_COPY_AND_ASSIGN(ExternalProtocolObserver); |
22 }; | 28 }; |
23 | 29 |
24 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_OBSERVER_H_ | 30 #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_EXTERNAL_PROTOCOL_OBSERVER_H_ |
OLD | NEW |