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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void InfoBarDelegate::StoreActiveEntryUniqueID( | 84 void InfoBarDelegate::StoreActiveEntryUniqueID( |
85 InfoBarTabHelper* infobar_helper) { | 85 InfoBarTabHelper* infobar_helper) { |
86 NavigationEntry* active_entry = | 86 NavigationEntry* active_entry = |
87 infobar_helper->tab_contents()->controller().GetActiveEntry(); | 87 infobar_helper->tab_contents()->controller().GetActiveEntry(); |
88 contents_unique_id_ = active_entry ? active_entry->unique_id() : 0; | 88 contents_unique_id_ = active_entry ? active_entry->unique_id() : 0; |
89 } | 89 } |
90 | 90 |
91 bool InfoBarDelegate::ShouldExpireInternal( | 91 bool InfoBarDelegate::ShouldExpireInternal( |
92 const content::LoadCommittedDetails& details) const { | 92 const content::LoadCommittedDetails& details) const { |
93 return (contents_unique_id_ != details.entry->unique_id()) || | 93 return (contents_unique_id_ != details.entry->unique_id()) || |
94 (PageTransition::StripQualifier(details.entry->transition_type()) == | 94 (content::PageTransitionStripQualifier( |
95 PageTransition::RELOAD); | 95 details.entry->transition_type()) == content::PAGE_TRANSITION_RELOAD); |
96 } | 96 } |
97 | 97 |
98 void InfoBarDelegate::RemoveSelf() { | 98 void InfoBarDelegate::RemoveSelf() { |
99 if (owner_) | 99 if (owner_) |
100 owner_->RemoveInfoBar(this); // Clears |owner_|. | 100 owner_->RemoveInfoBar(this); // Clears |owner_|. |
101 } | 101 } |
OLD | NEW |