Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: chrome/browser/tab_contents/infobar_delegate.cc

Issue 6262018: Cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents/infobar_delegate.h ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/infobar_delegate.cc
===================================================================
--- chrome/browser/tab_contents/infobar_delegate.cc (revision 72676)
+++ chrome/browser/tab_contents/infobar_delegate.cc (working copy)
@@ -42,16 +42,12 @@
return WARNING_TYPE;
}
-AlertInfoBarDelegate* InfoBarDelegate::AsAlertInfoBarDelegate() {
- return NULL;
-}
-
ConfirmInfoBarDelegate* InfoBarDelegate::AsConfirmInfoBarDelegate() {
return NULL;
}
CrashedExtensionInfoBarDelegate*
-InfoBarDelegate::AsCrashedExtensionInfoBarDelegate() {
+ InfoBarDelegate::AsCrashedExtensionInfoBarDelegate() {
return NULL;
}
@@ -84,26 +80,6 @@
}
-// AlertInfoBarDelegate -------------------------------------------------------
-
-bool AlertInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
- AlertInfoBarDelegate* alert_delegate = delegate->AsAlertInfoBarDelegate();
- return alert_delegate &&
- (alert_delegate->GetMessageText() == GetMessageText());
-}
-
-AlertInfoBarDelegate::AlertInfoBarDelegate(TabContents* contents)
- : InfoBarDelegate(contents) {
-}
-
-AlertInfoBarDelegate::~AlertInfoBarDelegate() {
-}
-
-AlertInfoBarDelegate* AlertInfoBarDelegate::AsAlertInfoBarDelegate() {
- return this;
-}
-
-
// LinkInfoBarDelegate --------------------------------------------------------
string16 LinkInfoBarDelegate::GetMessageTextWithOffset(
@@ -131,7 +107,7 @@
// ConfirmInfoBarDelegate -----------------------------------------------------
int ConfirmInfoBarDelegate::GetButtons() const {
- return BUTTON_NONE;
+ return BUTTON_OK | BUTTON_CANCEL;
}
string16 ConfirmInfoBarDelegate::GetButtonLabel(InfoBarButton button) const {
@@ -159,12 +135,19 @@
}
ConfirmInfoBarDelegate::ConfirmInfoBarDelegate(TabContents* contents)
- : AlertInfoBarDelegate(contents) {
+ : InfoBarDelegate(contents) {
}
ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() {
}
+bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
+ ConfirmInfoBarDelegate* confirm_delegate =
+ delegate->AsConfirmInfoBarDelegate();
+ return confirm_delegate &&
+ (confirm_delegate->GetMessageText() == GetMessageText());
+}
+
ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() {
return this;
}
@@ -177,7 +160,7 @@
SkBitmap* icon,
const string16& message,
bool auto_expire)
- : AlertInfoBarDelegate(contents),
+ : ConfirmInfoBarDelegate(contents),
icon_(icon),
message_(message),
auto_expire_(auto_expire) {
@@ -188,7 +171,7 @@
bool SimpleAlertInfoBarDelegate::ShouldExpire(
const NavigationController::LoadCommittedDetails& details) const {
- return auto_expire_ && AlertInfoBarDelegate::ShouldExpire(details);
+ return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details);
}
void SimpleAlertInfoBarDelegate::InfoBarClosed() {
@@ -202,3 +185,7 @@
string16 SimpleAlertInfoBarDelegate::GetMessageText() const {
return message_;
}
+
+int SimpleAlertInfoBarDelegate::GetButtons() const {
+ return BUTTON_NONE;
+}
Elliot Glaysher 2011/01/26 20:52:22 Linter wants newline
Peter Kasting 2011/01/26 20:56:01 It has a newline. The linter is wrong about this
« no previous file with comments | « chrome/browser/tab_contents/infobar_delegate.h ('k') | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698