| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 RegisterProtocolHandlerInfoBarDelegate* | 79 RegisterProtocolHandlerInfoBarDelegate* |
| 80 InfoBarDelegate::AsRegisterProtocolHandlerInfoBarDelegate() { | 80 InfoBarDelegate::AsRegisterProtocolHandlerInfoBarDelegate() { |
| 81 return NULL; | 81 return NULL; |
| 82 } | 82 } |
| 83 | 83 |
| 84 ThemeInstalledInfoBarDelegate* | 84 ThemeInstalledInfoBarDelegate* |
| 85 InfoBarDelegate::AsThemePreviewInfobarDelegate() { | 85 InfoBarDelegate::AsThemePreviewInfobarDelegate() { |
| 86 return NULL; | 86 return NULL; |
| 87 } | 87 } |
| 88 | 88 |
| 89 ThreeDAPIInfoBarDelegate* InfoBarDelegate::AsThreeDAPIInfoBarDelegate() { |
| 90 return NULL; |
| 91 } |
| 92 |
| 89 TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() { | 93 TranslateInfoBarDelegate* InfoBarDelegate::AsTranslateInfoBarDelegate() { |
| 90 return NULL; | 94 return NULL; |
| 91 } | 95 } |
| 92 | 96 |
| 93 InfoBarDelegate::InfoBarDelegate(InfoBarService* infobar_service) | 97 InfoBarDelegate::InfoBarDelegate(InfoBarService* infobar_service) |
| 94 : contents_unique_id_(0), | 98 : contents_unique_id_(0), |
| 95 owner_(infobar_service) { | 99 owner_(infobar_service) { |
| 96 if (infobar_service) | 100 if (infobar_service) |
| 97 StoreActiveEntryUniqueID(infobar_service); | 101 StoreActiveEntryUniqueID(infobar_service); |
| 98 } | 102 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 109 return (contents_unique_id_ != details.entry->GetUniqueID()) || | 113 return (contents_unique_id_ != details.entry->GetUniqueID()) || |
| 110 (content::PageTransitionStripQualifier( | 114 (content::PageTransitionStripQualifier( |
| 111 details.entry->GetTransitionType()) == | 115 details.entry->GetTransitionType()) == |
| 112 content::PAGE_TRANSITION_RELOAD); | 116 content::PAGE_TRANSITION_RELOAD); |
| 113 } | 117 } |
| 114 | 118 |
| 115 void InfoBarDelegate::RemoveSelf() { | 119 void InfoBarDelegate::RemoveSelf() { |
| 116 if (owner_) | 120 if (owner_) |
| 117 owner_->RemoveInfoBar(this); // Clears |owner_|. | 121 owner_->RemoveInfoBar(this); // Clears |owner_|. |
| 118 } | 122 } |
| OLD | NEW |