| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/infobars/core/infobar_delegate.h" | 5 #include "components/infobars/core/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 "components/infobars/core/infobar.h" | 9 #include "components/infobars/core/infobar.h" |
| 10 #include "components/infobars/core/infobar_manager.h" | 10 #include "components/infobars/core/infobar_manager.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 ScreenCaptureInfoBarDelegate* | 77 ScreenCaptureInfoBarDelegate* |
| 78 InfoBarDelegate::AsScreenCaptureInfoBarDelegate() { | 78 InfoBarDelegate::AsScreenCaptureInfoBarDelegate() { |
| 79 return NULL; | 79 return NULL; |
| 80 } | 80 } |
| 81 | 81 |
| 82 ThemeInstalledInfoBarDelegate* | 82 ThemeInstalledInfoBarDelegate* |
| 83 InfoBarDelegate::AsThemePreviewInfobarDelegate() { | 83 InfoBarDelegate::AsThemePreviewInfobarDelegate() { |
| 84 return NULL; | 84 return NULL; |
| 85 } | 85 } |
| 86 | 86 |
| 87 TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() { | 87 translate::TranslateInfoBarDelegate* |
| 88 InfoBarDelegate::AsTranslateInfoBarDelegate() { |
| 88 return NULL; | 89 return NULL; |
| 89 } | 90 } |
| 90 | 91 |
| 91 void InfoBarDelegate::StoreActiveEntryUniqueID() { | 92 void InfoBarDelegate::StoreActiveEntryUniqueID() { |
| 92 contents_unique_id_ = infobar()->owner()->GetActiveEntryID(); | 93 contents_unique_id_ = infobar()->owner()->GetActiveEntryID(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 gfx::Image InfoBarDelegate::GetIcon() const { | 96 gfx::Image InfoBarDelegate::GetIcon() const { |
| 96 int icon_id = GetIconID(); | 97 int icon_id = GetIconID(); |
| 97 return (icon_id == kNoIconID) ? gfx::Image() : | 98 return (icon_id == kNoIconID) ? gfx::Image() : |
| 98 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id); | 99 ResourceBundle::GetSharedInstance().GetNativeImageNamed(icon_id); |
| 99 } | 100 } |
| 100 | 101 |
| 101 InfoBarDelegate::InfoBarDelegate() : contents_unique_id_(0) { | 102 InfoBarDelegate::InfoBarDelegate() : contents_unique_id_(0) { |
| 102 } | 103 } |
| 103 | 104 |
| 104 bool InfoBarDelegate::ShouldExpireInternal( | 105 bool InfoBarDelegate::ShouldExpireInternal( |
| 105 const NavigationDetails& details) const { | 106 const NavigationDetails& details) const { |
| 106 // NOTE: If you change this, be sure to check and adjust the behavior of | 107 // NOTE: If you change this, be sure to check and adjust the behavior of |
| 107 // anyone who overrides this as necessary! | 108 // anyone who overrides this as necessary! |
| 108 return (contents_unique_id_ != details.entry_id) || details.is_reload; | 109 return (contents_unique_id_ != details.entry_id) || details.is_reload; |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace infobars | 112 } // namespace infobars |
| OLD | NEW |