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

Side by Side Diff: chrome/browser/ui/android/infobars/confirm_infobar.cc

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/android/infobars/confirm_infobar.h" 5 #include "chrome/browser/ui/android/infobars/confirm_infobar.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "chrome/browser/infobars/infobar_service.h" 12 #include "chrome/browser/infobars/infobar_service.h"
13 #include "components/infobars/core/confirm_infobar_delegate.h" 13 #include "components/infobars/core/confirm_infobar_delegate.h"
14 #include "content/public/browser/android/content_view_core.h" 14 #include "content/public/browser/android/content_view_core.h"
15 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
16 #include "jni/ConfirmInfoBar_jni.h" 16 #include "jni/ConfirmInfoBar_jni.h"
17 #include "ui/android/window_android.h" 17 #include "ui/android/window_android.h"
18 #include "ui/gfx/android/java_bitmap.h" 18 #include "ui/gfx/android/java_bitmap.h"
19 #include "ui/gfx/image/image.h" 19 #include "ui/gfx/image/image.h"
20 20
21 using base::android::JavaParamRef; 21 using base::android::JavaParamRef;
22 using base::android::ScopedJavaLocalRef; 22 using base::android::ScopedJavaLocalRef;
23 23
24 // InfoBarService ------------------------------------------------------------- 24 // InfoBarService -------------------------------------------------------------
25 25
26 std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( 26 std::unique_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar(
27 std::unique_ptr<ConfirmInfoBarDelegate> delegate) { 27 std::unique_ptr<ConfirmInfoBarDelegate> delegate) {
28 return base::WrapUnique(new ConfirmInfoBar(std::move(delegate))); 28 return base::MakeUnique<ConfirmInfoBar>(std::move(delegate));
29 } 29 }
30 30
31 31
32 // ConfirmInfoBar ------------------------------------------------------------- 32 // ConfirmInfoBar -------------------------------------------------------------
33 33
34 ConfirmInfoBar::ConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate> delegate) 34 ConfirmInfoBar::ConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate> delegate)
35 : InfoBarAndroid(std::move(delegate)) {} 35 : InfoBarAndroid(std::move(delegate)) {}
36 36
37 ConfirmInfoBar::~ConfirmInfoBar() { 37 ConfirmInfoBar::~ConfirmInfoBar() {
38 } 38 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { 95 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() {
96 return delegate()->AsConfirmInfoBarDelegate(); 96 return delegate()->AsConfirmInfoBarDelegate();
97 } 97 }
98 98
99 base::string16 ConfirmInfoBar::GetTextFor( 99 base::string16 ConfirmInfoBar::GetTextFor(
100 ConfirmInfoBarDelegate::InfoBarButton button) { 100 ConfirmInfoBarDelegate::InfoBarButton button) {
101 ConfirmInfoBarDelegate* delegate = GetDelegate(); 101 ConfirmInfoBarDelegate* delegate = GetDelegate();
102 return (delegate->GetButtons() & button) ? 102 return (delegate->GetButtons() & button) ?
103 delegate->GetButtonLabel(button) : base::string16(); 103 delegate->GetButtonLabel(button) : base::string16();
104 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698