| 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 "content/browser/tab_contents/navigation_controller.h" | 9 #include "content/browser/tab_contents/navigation_controller.h" |
| 10 #include "content/browser/tab_contents/navigation_entry.h" | 10 #include "content/browser/tab_contents/navigation_entry.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 const NavigationController::LoadCommittedDetails& details) const { | 23 const NavigationController::LoadCommittedDetails& details) const { |
| 24 return (contents_unique_id_ != details.entry->unique_id()) || | 24 return (contents_unique_id_ != details.entry->unique_id()) || |
| 25 (PageTransition::StripQualifier(details.entry->transition_type()) == | 25 (PageTransition::StripQualifier(details.entry->transition_type()) == |
| 26 PageTransition::RELOAD); | 26 PageTransition::RELOAD); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void InfoBarDelegate::InfoBarDismissed() { | 29 void InfoBarDelegate::InfoBarDismissed() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 void InfoBarDelegate::InfoBarClosed() { | 32 void InfoBarDelegate::InfoBarClosed() { |
| 33 delete this; |
| 33 } | 34 } |
| 34 | 35 |
| 35 gfx::Image* InfoBarDelegate::GetIcon() const { | 36 gfx::Image* InfoBarDelegate::GetIcon() const { |
| 36 return NULL; | 37 return NULL; |
| 37 } | 38 } |
| 38 | 39 |
| 39 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const { | 40 InfoBarDelegate::Type InfoBarDelegate::GetInfoBarType() const { |
| 40 return WARNING_TYPE; | 41 return WARNING_TYPE; |
| 41 } | 42 } |
| 42 | 43 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 69 InfoBarDelegate::InfoBarDelegate(TabContents* contents) | 70 InfoBarDelegate::InfoBarDelegate(TabContents* contents) |
| 70 : contents_unique_id_(0) { | 71 : contents_unique_id_(0) { |
| 71 if (contents) | 72 if (contents) |
| 72 StoreActiveEntryUniqueID(contents); | 73 StoreActiveEntryUniqueID(contents); |
| 73 } | 74 } |
| 74 | 75 |
| 75 void InfoBarDelegate::StoreActiveEntryUniqueID(TabContents* contents) { | 76 void InfoBarDelegate::StoreActiveEntryUniqueID(TabContents* contents) { |
| 76 NavigationEntry* active_entry = contents->controller().GetActiveEntry(); | 77 NavigationEntry* active_entry = contents->controller().GetActiveEntry(); |
| 77 contents_unique_id_ = active_entry ? active_entry->unique_id() : 0; | 78 contents_unique_id_ = active_entry ? active_entry->unique_id() : 0; |
| 78 } | 79 } |
| OLD | NEW |