OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/permissions/permission_update_infobar_delegate_android.
h" | 5 #include "chrome/browser/permissions/permission_update_infobar_delegate_android.
h" |
6 | 6 |
7 #include "base/android/jni_array.h" | 7 #include "base/android/jni_array.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/android/preferences/pref_service_bridge.h" | 10 #include "chrome/browser/android/preferences/pref_service_bridge.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 reinterpret_cast<intptr_t>(this), | 141 reinterpret_cast<intptr_t>(this), |
142 web_contents->GetJavaWebContents().obj(), | 142 web_contents->GetJavaWebContents().obj(), |
143 base::android::ToJavaArrayOfStrings(env, android_permissions_).obj())); | 143 base::android::ToJavaArrayOfStrings(env, android_permissions_).obj())); |
144 } | 144 } |
145 | 145 |
146 PermissionUpdateInfoBarDelegate::~PermissionUpdateInfoBarDelegate() { | 146 PermissionUpdateInfoBarDelegate::~PermissionUpdateInfoBarDelegate() { |
147 Java_PermissionUpdateInfoBarDelegate_onNativeDestroyed( | 147 Java_PermissionUpdateInfoBarDelegate_onNativeDestroyed( |
148 base::android::AttachCurrentThread(), java_delegate_.obj()); | 148 base::android::AttachCurrentThread(), java_delegate_.obj()); |
149 } | 149 } |
150 | 150 |
| 151 infobars::InfoBarDelegate::InfoBarIdentifier |
| 152 PermissionUpdateInfoBarDelegate::GetIdentifier() const { |
| 153 return PERMISSION_UPDATE_INFOBAR_DELEGATE; |
| 154 } |
| 155 |
151 int PermissionUpdateInfoBarDelegate::GetIconId() const { | 156 int PermissionUpdateInfoBarDelegate::GetIconId() const { |
152 return IDR_INFOBAR_WARNING; | 157 return IDR_INFOBAR_WARNING; |
153 } | 158 } |
154 | 159 |
155 base::string16 PermissionUpdateInfoBarDelegate::GetMessageText() const { | 160 base::string16 PermissionUpdateInfoBarDelegate::GetMessageText() const { |
156 return l10n_util::GetStringUTF16(permission_msg_id_); | 161 return l10n_util::GetStringUTF16(permission_msg_id_); |
157 } | 162 } |
158 | 163 |
159 int PermissionUpdateInfoBarDelegate::GetButtons() const { | 164 int PermissionUpdateInfoBarDelegate::GetButtons() const { |
160 return BUTTON_OK; | 165 return BUTTON_OK; |
(...skipping 12 matching lines...) Expand all Loading... |
173 } | 178 } |
174 | 179 |
175 bool PermissionUpdateInfoBarDelegate::Cancel() { | 180 bool PermissionUpdateInfoBarDelegate::Cancel() { |
176 base::ResetAndReturn(&callback_).Run(false); | 181 base::ResetAndReturn(&callback_).Run(false); |
177 return true; | 182 return true; |
178 } | 183 } |
179 | 184 |
180 void PermissionUpdateInfoBarDelegate::InfoBarDismissed() { | 185 void PermissionUpdateInfoBarDelegate::InfoBarDismissed() { |
181 base::ResetAndReturn(&callback_).Run(false); | 186 base::ResetAndReturn(&callback_).Run(false); |
182 } | 187 } |
OLD | NEW |