| 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 #include "chrome/browser/infobars/infobar_delegate.h" | 5 #include "chrome/browser/infobars/infobar_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/infobars/infobar_tab_helper.h" | 9 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 10 #include "content/browser/tab_contents/navigation_details.h" | 10 #include "content/browser/tab_contents/navigation_details.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 const content::LoadCommittedDetails& details) const { | 24 const content::LoadCommittedDetails& details) const { |
| 25 if (!details.is_navigation_to_different_page()) | 25 if (!details.is_navigation_to_different_page()) |
| 26 return false; | 26 return false; |
| 27 | 27 |
| 28 return ShouldExpireInternal(details); | 28 return ShouldExpireInternal(details); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void InfoBarDelegate::InfoBarDismissed() { | 31 void InfoBarDelegate::InfoBarDismissed() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 void InfoBarDelegate::InfoBarClosed() { | |
| 35 delete this; | |
| 36 } | |
| 37 | |
| 38 gfx::Image* InfoBarDelegate::GetIcon() const { | 34 gfx::Image* InfoBarDelegate::GetIcon() const { |
| 39 return NULL; | 35 return NULL; |
| 40 } | 36 } |
| 41 | 37 |
| 42 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const { | 38 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const { |
| 43 return WARNING_TYPE; | 39 return WARNING_TYPE; |
| 44 } | 40 } |
| 45 | 41 |
| 46 ConfirmInfoBarDelegate* InfoBarDelegate::AsConfirmInfoBarDelegate() { | 42 ConfirmInfoBarDelegate* InfoBarDelegate::AsConfirmInfoBarDelegate() { |
| 47 return NULL; | 43 return NULL; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const content::LoadCommittedDetails& details) const { | 88 const content::LoadCommittedDetails& details) const { |
| 93 return (contents_unique_id_ != details.entry->unique_id()) || | 89 return (contents_unique_id_ != details.entry->unique_id()) || |
| 94 (content::PageTransitionStripQualifier( | 90 (content::PageTransitionStripQualifier( |
| 95 details.entry->transition_type()) == content::PAGE_TRANSITION_RELOAD); | 91 details.entry->transition_type()) == content::PAGE_TRANSITION_RELOAD); |
| 96 } | 92 } |
| 97 | 93 |
| 98 void InfoBarDelegate::RemoveSelf() { | 94 void InfoBarDelegate::RemoveSelf() { |
| 99 if (owner_) | 95 if (owner_) |
| 100 owner_->RemoveInfoBar(this); // Clears |owner_|. | 96 owner_->RemoveInfoBar(this); // Clears |owner_|. |
| 101 } | 97 } |
| OLD | NEW |