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

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

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … Created 4 years, 8 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
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 "components/infobars/core/simple_alert_infobar_delegate.h" 5 #include "components/infobars/core/simple_alert_infobar_delegate.h"
6 6
7 #include <memory>
8
7 #include "components/infobars/core/infobar.h" 9 #include "components/infobars/core/infobar.h"
8 #include "components/infobars/core/infobar_manager.h" 10 #include "components/infobars/core/infobar_manager.h"
9 #include "third_party/skia/include/core/SkBitmap.h" 11 #include "third_party/skia/include/core/SkBitmap.h"
10 12
11 // static 13 // static
12 void SimpleAlertInfoBarDelegate::Create( 14 void SimpleAlertInfoBarDelegate::Create(
13 infobars::InfoBarManager* infobar_manager, 15 infobars::InfoBarManager* infobar_manager,
14 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier, 16 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier,
15 int icon_id, 17 int icon_id,
16 gfx::VectorIconId vector_icon_id, 18 gfx::VectorIconId vector_icon_id,
17 const base::string16& message, 19 const base::string16& message,
18 bool auto_expire) { 20 bool auto_expire) {
19 infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar( 21 infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar(
20 scoped_ptr<ConfirmInfoBarDelegate>(new SimpleAlertInfoBarDelegate( 22 std::unique_ptr<ConfirmInfoBarDelegate>(new SimpleAlertInfoBarDelegate(
21 infobar_identifier, icon_id, vector_icon_id, message, auto_expire)))); 23 infobar_identifier, icon_id, vector_icon_id, message, auto_expire))));
22 } 24 }
23 25
24 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate( 26 SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
25 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier, 27 infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier,
26 int icon_id, 28 int icon_id,
27 gfx::VectorIconId vector_icon_id, 29 gfx::VectorIconId vector_icon_id,
28 const base::string16& message, 30 const base::string16& message,
29 bool auto_expire) 31 bool auto_expire)
30 : ConfirmInfoBarDelegate(), 32 : ConfirmInfoBarDelegate(),
(...skipping 24 matching lines...) Expand all
55 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details); 57 return auto_expire_ && ConfirmInfoBarDelegate::ShouldExpire(details);
56 } 58 }
57 59
58 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const { 60 base::string16 SimpleAlertInfoBarDelegate::GetMessageText() const {
59 return message_; 61 return message_;
60 } 62 }
61 63
62 int SimpleAlertInfoBarDelegate::GetButtons() const { 64 int SimpleAlertInfoBarDelegate::GetButtons() const {
63 return BUTTON_NONE; 65 return BUTTON_NONE;
64 } 66 }
OLDNEW
« no previous file with comments | « components/infobars/core/infobar_manager.cc ('k') | components/keyed_service/content/browser_context_dependency_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698