Chromium Code Reviews| 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 // Makes it so the next reload is ignored. That is, if the next commit is a | |
| 41 // reload than it is treated as if nothing happened and no infobars are | |
|
Peter Kasting
2014/09/18 17:48:04
Nit: than -> then
sky
2014/09/18 19:22:27
Done.
| |
| 42 // attempted to be closed. | |
|
Peter Kasting
2014/09/18 17:48:04
Nit: Remove "attempted to be"
Consider adding a m
sky
2014/09/18 19:22:27
Done.
| |
| 43 void set_ignore_next_reload() { ignore_next_reload_ = true; } | |
| 44 | |
| 40 private: | 45 private: |
| 41 friend class content::WebContentsUserData<InfoBarService>; | 46 friend class content::WebContentsUserData<InfoBarService>; |
| 42 | 47 |
| 43 explicit InfoBarService(content::WebContents* web_contents); | 48 explicit InfoBarService(content::WebContents* web_contents); |
| 44 virtual ~InfoBarService(); | 49 virtual ~InfoBarService(); |
| 45 | 50 |
| 46 // InfoBarManager: | 51 // InfoBarManager: |
| 47 virtual int GetActiveEntryID() OVERRIDE; | 52 virtual int GetActiveEntryID() OVERRIDE; |
| 48 // TODO(droger): Remove these functions once infobar notifications are | 53 // TODO(droger): Remove these functions once infobar notifications are |
| 49 // removed. See http://crbug.com/354380 | 54 // removed. See http://crbug.com/354380 |
| 50 virtual void NotifyInfoBarAdded(infobars::InfoBar* infobar) OVERRIDE; | 55 virtual void NotifyInfoBarAdded(infobars::InfoBar* infobar) OVERRIDE; |
| 51 virtual void NotifyInfoBarRemoved(infobars::InfoBar* infobar, | 56 virtual void NotifyInfoBarRemoved(infobars::InfoBar* infobar, |
| 52 bool animate) OVERRIDE; | 57 bool animate) OVERRIDE; |
| 53 | 58 |
| 54 // content::WebContentsObserver: | 59 // content::WebContentsObserver: |
| 55 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 60 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
| 61 virtual void DidStartNavigationToPendingEntry( | |
| 62 const GURL& url, | |
| 63 content::NavigationController::ReloadType reload_type) OVERRIDE; | |
| 56 virtual void NavigationEntryCommitted( | 64 virtual void NavigationEntryCommitted( |
| 57 const content::LoadCommittedDetails& load_details) OVERRIDE; | 65 const content::LoadCommittedDetails& load_details) OVERRIDE; |
| 58 virtual void WebContentsDestroyed() OVERRIDE; | 66 virtual void WebContentsDestroyed() OVERRIDE; |
| 59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 67 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 60 | 68 |
| 61 // Message handlers. | 69 // Message handlers. |
| 62 void OnDidBlockDisplayingInsecureContent(); | 70 void OnDidBlockDisplayingInsecureContent(); |
| 63 void OnDidBlockRunningInsecureContent(); | 71 void OnDidBlockRunningInsecureContent(); |
| 64 | 72 |
| 73 // See description in set_ignore_next_reload(). | |
| 74 bool ignore_next_reload_; | |
| 65 | 75 |
| 66 DISALLOW_COPY_AND_ASSIGN(InfoBarService); | 76 DISALLOW_COPY_AND_ASSIGN(InfoBarService); |
| 67 }; | 77 }; |
| 68 | 78 |
| 69 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ | 79 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_SERVICE_H_ |
| OLD | NEW |