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

Side by Side Diff: chrome/browser/infobars/simple_alert_infobar_delegate.cc

Issue 824033002: Componentize SimpleAlertInfoBarDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h"
6
7 #include "chrome/browser/infobars/infobar_service.h"
8 #include "components/infobars/core/infobar.h"
9 #include "third_party/skia/include/core/SkBitmap.h"
10
11 // static
12 void SimpleAlertInfoBarDelegate::Create(InfoBarService* infobar_service,
13 int icon_id,
14 const base::string16& message,
15 bool auto_expire) {
16 infobar_service->AddInfoBar(
17 infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
18 new SimpleAlertInfoBarDelegate(icon_id, message, auto_expire))));
19 }
20
21 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
22 int icon_id,
23 const base::string16& message,
24 bool auto_expire)
25 : ConfirmInfoBarDelegate(),
26 icon_id_(icon_id),
27 message_(message),
28 auto_expire_(auto_expire) {
29 }
30
31 SimpleAlertInfoBarDelegate::~SimpleAlertInfoBarDelegate() {
32 }
33
34 int SimpleAlertInfoBarDelegate::GetIconID() const {
35 return icon_id_;
36 }
37
38 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const {
39 return message_;
40 }
41
42 int SimpleAlertInfoBarDelegate::GetButtons() const {
43 return BUTTON_NONE;
44 }
45
46 bool SimpleAlertInfoBarDelegate::ShouldExpireInternal(
47 const NavigationDetails& details) const {
48 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpireInternal(details);
49 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/simple_alert_infobar_delegate.h ('k') | chrome/browser/plugins/plugin_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698