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

Side by Side Diff: chrome/browser/tab_contents/confirm_infobar_delegate.cc

Issue 7205026: Don't rely on user gestures for deciding when to dismiss infobars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/confirm_infobar_delegate.h" 5 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
6 6
7 #include "content/browser/tab_contents/navigation_details.h"
7 #include "content/browser/tab_contents/tab_contents.h" 8 #include "content/browser/tab_contents/tab_contents.h"
8 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
10 11
11 int ConfirmInfoBarDelegate::GetButtons() const { 12 int ConfirmInfoBarDelegate::GetButtons() const {
12 return BUTTON_OK | BUTTON_CANCEL; 13 return BUTTON_OK | BUTTON_CANCEL;
13 } 14 }
14 15
15 string16 ConfirmInfoBarDelegate::GetButtonLabel(InfoBarButton button) const { 16 string16 ConfirmInfoBarDelegate::GetButtonLabel(InfoBarButton button) const {
16 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_CANCEL); 17 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_CANCEL);
(...skipping 26 matching lines...) Expand all
43 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() { 44 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() {
44 } 45 }
45 46
46 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { 47 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
47 ConfirmInfoBarDelegate* confirm_delegate = 48 ConfirmInfoBarDelegate* confirm_delegate =
48 delegate->AsConfirmInfoBarDelegate(); 49 delegate->AsConfirmInfoBarDelegate();
49 return confirm_delegate && 50 return confirm_delegate &&
50 (confirm_delegate->GetMessageText() == GetMessageText()); 51 (confirm_delegate->GetMessageText() == GetMessageText());
51 } 52 }
52 53
54 bool ConfirmInfoBarDelegate::ShouldExpire(
55 const content::LoadCommittedDetails& details) const {
56 if (details.did_replace_entry)
57 return false;
58 return InfoBarDelegate::ShouldExpire(details);
59 }
60
53 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { 61 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() {
54 return this; 62 return this;
55 } 63 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/confirm_infobar_delegate.h ('k') | chrome/browser/tab_contents/infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698