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

Side by Side Diff: components/infobars/core/confirm_infobar_delegate.cc

Issue 289083004: infobars: Componentize ConfirmInfoBarDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « components/infobars/core/confirm_infobar_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/infobars/confirm_infobar_delegate.h" 5 #include "components/infobars/core/confirm_infobar_delegate.h"
6 6
7 #include "grit/generated_resources.h" 7 #include "grit/ui_strings.h"
8 #include "ui/base/l10n/l10n_util.h" 8 #include "ui/base/l10n/l10n_util.h"
9 9
10 using infobars::InfoBarDelegate; 10 using infobars::InfoBarDelegate;
11 11
12 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() { 12 ConfirmInfoBarDelegate::~ConfirmInfoBarDelegate() {
13 } 13 }
14 14
15 InfoBarDelegate::InfoBarAutomationType 15 InfoBarDelegate::InfoBarAutomationType
16 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const { 16 ConfirmInfoBarDelegate::GetInfoBarAutomationType() const {
17 return CONFIRM_INFOBAR; 17 return CONFIRM_INFOBAR;
18 } 18 }
19 19
20 int ConfirmInfoBarDelegate::GetButtons() const { 20 int ConfirmInfoBarDelegate::GetButtons() const {
21 return BUTTON_OK | BUTTON_CANCEL; 21 return BUTTON_OK | BUTTON_CANCEL;
22 } 22 }
23 23
24 base::string16 ConfirmInfoBarDelegate::GetButtonLabel( 24 base::string16 ConfirmInfoBarDelegate::GetButtonLabel(
25 InfoBarButton button) const { 25 InfoBarButton button) const {
26 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_CANCEL); 26 return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
27 IDS_APP_OK : IDS_APP_CANCEL);
27 } 28 }
28 29
29 bool ConfirmInfoBarDelegate::OKButtonTriggersUACPrompt() const { 30 bool ConfirmInfoBarDelegate::OKButtonTriggersUACPrompt() const {
30 return false; 31 return false;
31 } 32 }
32 33
33 bool ConfirmInfoBarDelegate::Accept() { 34 bool ConfirmInfoBarDelegate::Accept() {
34 return true; 35 return true;
35 } 36 }
36 37
(...skipping 25 matching lines...) Expand all
62 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { 63 bool ConfirmInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
63 ConfirmInfoBarDelegate* confirm_delegate = 64 ConfirmInfoBarDelegate* confirm_delegate =
64 delegate->AsConfirmInfoBarDelegate(); 65 delegate->AsConfirmInfoBarDelegate();
65 return confirm_delegate && 66 return confirm_delegate &&
66 (confirm_delegate->GetMessageText() == GetMessageText()); 67 (confirm_delegate->GetMessageText() == GetMessageText());
67 } 68 }
68 69
69 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() { 70 ConfirmInfoBarDelegate* ConfirmInfoBarDelegate::AsConfirmInfoBarDelegate() {
70 return this; 71 return this;
71 } 72 }
OLDNEW
« no previous file with comments | « components/infobars/core/confirm_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698