| 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 #include "chrome/browser/api/infobars/infobar_delegate.h" | 5 #include "chrome/browser/api/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/api/infobars/infobar_service.h" | 9 #include "chrome/browser/api/infobars/infobar_service.h" |
| 10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 const content::LoadCommittedDetails& details) const { | 32 const content::LoadCommittedDetails& details) const { |
| 33 if (!details.is_navigation_to_different_page()) | 33 if (!details.is_navigation_to_different_page()) |
| 34 return false; | 34 return false; |
| 35 | 35 |
| 36 return ShouldExpireInternal(details); | 36 return ShouldExpireInternal(details); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void InfoBarDelegate::InfoBarDismissed() { | 39 void InfoBarDelegate::InfoBarDismissed() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 void InfoBarDelegate::InfoBarClosed() { | |
| 43 delete this; | |
| 44 } | |
| 45 | |
| 46 gfx::Image* InfoBarDelegate::GetIcon() const { | 42 gfx::Image* InfoBarDelegate::GetIcon() const { |
| 47 return NULL; | 43 return NULL; |
| 48 } | 44 } |
| 49 | 45 |
| 50 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const { | 46 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const { |
| 51 return WARNING_TYPE; | 47 return WARNING_TYPE; |
| 52 } | 48 } |
| 53 | 49 |
| 54 AlternateNavInfoBarDelegate* InfoBarDelegate::AsAlternateNavInfoBarDelegate() { | 50 AlternateNavInfoBarDelegate* InfoBarDelegate::AsAlternateNavInfoBarDelegate() { |
| 55 return NULL; | 51 return NULL; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 return (contents_unique_id_ != details.entry->GetUniqueID()) || | 112 return (contents_unique_id_ != details.entry->GetUniqueID()) || |
| 117 (content::PageTransitionStripQualifier( | 113 (content::PageTransitionStripQualifier( |
| 118 details.entry->GetTransitionType()) == | 114 details.entry->GetTransitionType()) == |
| 119 content::PAGE_TRANSITION_RELOAD); | 115 content::PAGE_TRANSITION_RELOAD); |
| 120 } | 116 } |
| 121 | 117 |
| 122 void InfoBarDelegate::RemoveSelf() { | 118 void InfoBarDelegate::RemoveSelf() { |
| 123 if (owner_) | 119 if (owner_) |
| 124 owner_->RemoveInfoBar(this); // Clears |owner_|. | 120 owner_->RemoveInfoBar(this); // Clears |owner_|. |
| 125 } | 121 } |
| OLD | NEW |