| 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/tab_contents/infobar_delegate.h" | 5 #include "chrome/browser/tab_contents/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/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 10 #include "content/browser/tab_contents/navigation_details.h" | 11 #include "content/browser/tab_contents/navigation_details.h" |
| 11 #include "content/browser/tab_contents/navigation_entry.h" | 12 #include "content/browser/tab_contents/navigation_entry.h" |
| 12 #include "content/browser/tab_contents/tab_contents.h" | 13 #include "content/browser/tab_contents/tab_contents.h" |
| 13 | 14 |
| 14 // InfoBarDelegate ------------------------------------------------------------ | 15 // InfoBarDelegate ------------------------------------------------------------ |
| 15 | 16 |
| 16 InfoBarDelegate::~InfoBarDelegate() { | 17 InfoBarDelegate::~InfoBarDelegate() { |
| 17 } | 18 } |
| 18 | 19 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 bool InfoBarDelegate::ShouldExpireInternal( | 90 bool InfoBarDelegate::ShouldExpireInternal( |
| 90 const content::LoadCommittedDetails& details) const { | 91 const content::LoadCommittedDetails& details) const { |
| 91 return (contents_unique_id_ != details.entry->unique_id()) || | 92 return (contents_unique_id_ != details.entry->unique_id()) || |
| 92 (PageTransition::StripQualifier(details.entry->transition_type()) == | 93 (PageTransition::StripQualifier(details.entry->transition_type()) == |
| 93 PageTransition::RELOAD); | 94 PageTransition::RELOAD); |
| 94 } | 95 } |
| 95 | 96 |
| 96 void InfoBarDelegate::RemoveSelf() { | 97 void InfoBarDelegate::RemoveSelf() { |
| 97 if (owner_) { | 98 if (owner_) { |
| 98 TabContentsWrapper::GetCurrentWrapperForContents(owner_)-> | 99 TabContentsWrapper::GetCurrentWrapperForContents(owner_)-> |
| 99 RemoveInfoBar(this); // Clears |owner_|. | 100 infobar_tab_helper()->RemoveInfoBar(this); // Clears |owner_|. |
| 100 } | 101 } |
| 101 } | 102 } |
| OLD | NEW |