OLD | NEW |
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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/android/resource_mapper.h" | 10 #include "chrome/browser/android/resource_mapper.h" |
| 11 #include "chrome/browser/infobars/infobar_service.h" |
11 #include "components/infobars/core/confirm_infobar_delegate.h" | 12 #include "components/infobars/core/confirm_infobar_delegate.h" |
12 #include "jni/ConfirmInfoBarDelegate_jni.h" | 13 #include "jni/ConfirmInfoBarDelegate_jni.h" |
13 | 14 |
| 15 // InfoBarService ------------------------------------------------------------- |
14 | 16 |
15 // ConfirmInfoBarDelegate ----------------------------------------------------- | 17 scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( |
16 | |
17 // static | |
18 scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( | |
19 scoped_ptr<ConfirmInfoBarDelegate> delegate) { | 18 scoped_ptr<ConfirmInfoBarDelegate> delegate) { |
20 return make_scoped_ptr(new ConfirmInfoBar(delegate.Pass())); | 19 return make_scoped_ptr(new ConfirmInfoBar(delegate.Pass())); |
21 } | 20 } |
22 | 21 |
23 | 22 |
24 // ConfirmInfoBar ------------------------------------------------------------- | 23 // ConfirmInfoBar ------------------------------------------------------------- |
25 | 24 |
26 ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate) | 25 ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate) |
27 : InfoBarAndroid(delegate.Pass()), java_confirm_delegate_() { | 26 : InfoBarAndroid(delegate.Pass()), java_confirm_delegate_() { |
28 } | 27 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return (delegate->GetButtons() & button) ? | 83 return (delegate->GetButtons() & button) ? |
85 delegate->GetButtonLabel(button) : base::string16(); | 84 delegate->GetButtonLabel(button) : base::string16(); |
86 } | 85 } |
87 | 86 |
88 | 87 |
89 // Native JNI methods --------------------------------------------------------- | 88 // Native JNI methods --------------------------------------------------------- |
90 | 89 |
91 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) { | 90 bool RegisterConfirmInfoBarDelegate(JNIEnv* env) { |
92 return RegisterNativesImpl(env); | 91 return RegisterNativesImpl(env); |
93 } | 92 } |
OLD | NEW |