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

Side by Side Diff: chrome/browser/infobar_delegate.cc

Issue 11318: Beginnings of a new InfoBar system. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | « chrome/browser/infobar_delegate.h ('k') | chrome/browser/tab_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/infobar_delegate.h"
6
7 #include "base/logging.h"
8 #include "chrome/common/l10n_util.h"
9
10 #include "generated_resources.h"
11
12 // AlertInfoBarDelegate, InfoBarDelegate overrides: ----------------------------
13
14 bool AlertInfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const {
15 AlertInfoBarDelegate* alert_delegate = delegate->AsAlertInfoBarDelegate();
16 if (!alert_delegate)
17 return false;
18
19 return alert_delegate->GetMessageText() == GetMessageText();
20 }
21
22 // ConfirmInfoBarDelegate, public: ---------------------------------------------
23
24 std::wstring ConfirmInfoBarDelegate::GetButtonLabel(
25 InfoBarButton button) const {
26 if (button == BUTTON_OK)
27 return l10n_util::GetString(IDS_OK);
28 if (button == BUTTON_CANCEL)
29 return l10n_util::GetString(IDS_CANCEL);
30 NOTREACHED();
31 return std::wstring();
32 }
33
34 // SimpleAlertInfoBarDelegate, public: -----------------------------------------
35
36 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
37 const std::wstring& message, SkBitmap* icon)
38 : message_(message),
39 icon_(icon) {
40 }
41
42 // SimpleAlertInfoBarDelegate, AlertInfoBarDelegate implementation: ------------
43
44 std::wstring SimpleAlertInfoBarDelegate::GetMessageText() const {
45 return message_;
46 }
47
48 SkBitmap* SimpleAlertInfoBarDelegate::GetIcon() const {
49 return icon_;
50 }
51
52 void SimpleAlertInfoBarDelegate::InfoBarClosed() {
53 delete this;
54 }
OLDNEW
« no previous file with comments | « chrome/browser/infobar_delegate.h ('k') | chrome/browser/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698