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_INFOBARS_INFOBAR_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ |
6 #define CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ | 6 #define CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 static infobars::InfoBarDelegate::NavigationDetails | 30 static infobars::InfoBarDelegate::NavigationDetails |
31 NavigationDetailsFromLoadCommittedDetails( | 31 NavigationDetailsFromLoadCommittedDetails( |
32 const content::LoadCommittedDetails& details); | 32 const content::LoadCommittedDetails& details); |
33 | 33 |
34 // This function must only be called on infobars that are owned by an | 34 // This function must only be called on infobars that are owned by an |
35 // InfoBarService instance (or not owned at all, in which case this returns | 35 // InfoBarService instance (or not owned at all, in which case this returns |
36 // NULL). | 36 // NULL). |
37 static content::WebContents* WebContentsFromInfoBar( | 37 static content::WebContents* WebContentsFromInfoBar( |
38 infobars::InfoBar* infobar); | 38 infobars::InfoBar* infobar); |
39 | 39 |
40 // Retrieve the WebContents for the tab this service is associated with. | |
41 content::WebContents* web_contents() { | |
42 return content::WebContentsObserver::web_contents(); | |
43 } | |
44 | |
45 private: | 40 private: |
46 friend class content::WebContentsUserData<InfoBarService>; | 41 friend class content::WebContentsUserData<InfoBarService>; |
47 | 42 |
48 explicit InfoBarService(content::WebContents* web_contents); | 43 explicit InfoBarService(content::WebContents* web_contents); |
49 virtual ~InfoBarService(); | 44 virtual ~InfoBarService(); |
50 | 45 |
51 // InfoBarManager: | 46 // InfoBarManager: |
52 virtual int GetActiveEntryID() OVERRIDE; | 47 virtual int GetActiveEntryID() OVERRIDE; |
53 // TODO(droger): Remove these functions once infobar notifications are | 48 // TODO(droger): Remove these functions once infobar notifications are |
54 // removed. See http://crbug.com/354380 | 49 // removed. See http://crbug.com/354380 |
(...skipping 10 matching lines...) Expand all Loading... |
65 | 60 |
66 // Message handlers. | 61 // Message handlers. |
67 void OnDidBlockDisplayingInsecureContent(); | 62 void OnDidBlockDisplayingInsecureContent(); |
68 void OnDidBlockRunningInsecureContent(); | 63 void OnDidBlockRunningInsecureContent(); |
69 | 64 |
70 | 65 |
71 DISALLOW_COPY_AND_ASSIGN(InfoBarService); | 66 DISALLOW_COPY_AND_ASSIGN(InfoBarService); |
72 }; | 67 }; |
73 | 68 |
74 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ | 69 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ |
OLD | NEW |