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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
11 #include "chrome/browser/android/preferences/pref_service_bridge.h" | 11 #include "chrome/browser/android/preferences/pref_service_bridge.h" |
12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
13 #include "chrome/grit/chromium_strings.h" | 13 #include "chrome/grit/chromium_strings.h" |
14 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
15 #include "chrome/grit/theme_resources.h" | 15 #include "chrome/grit/theme_resources.h" |
16 #include "components/infobars/core/infobar.h" | 16 #include "components/infobars/core/infobar.h" |
17 #include "content/public/browser/android/content_view_core.h" | 17 #include "content/public/browser/android/content_view_core.h" |
18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
19 #include "jni/PermissionUpdateInfoBarDelegate_jni.h" | 19 #include "jni/PermissionUpdateInfoBarDelegate_jni.h" |
20 #include "ui/android/window_android.h" | 20 #include "ui/android/window_android.h" |
21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
22 | 22 |
| 23 using base::android::JavaParamRef; |
| 24 |
23 // static | 25 // static |
24 infobars::InfoBar* PermissionUpdateInfoBarDelegate::Create( | 26 infobars::InfoBar* PermissionUpdateInfoBarDelegate::Create( |
25 content::WebContents* web_contents, | 27 content::WebContents* web_contents, |
26 const std::vector<ContentSettingsType>& content_settings_types, | 28 const std::vector<ContentSettingsType>& content_settings_types, |
27 const PermissionUpdatedCallback& callback) { | 29 const PermissionUpdatedCallback& callback) { |
28 DCHECK(ShouldShowPermissionInfobar(web_contents, content_settings_types)) | 30 DCHECK(ShouldShowPermissionInfobar(web_contents, content_settings_types)) |
29 << "Caller should check ShouldShowPermissionInfobar before creating the " | 31 << "Caller should check ShouldShowPermissionInfobar before creating the " |
30 << "infobar."; | 32 << "infobar."; |
31 | 33 |
32 content::ContentViewCore* cvc = | 34 content::ContentViewCore* cvc = |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 180 } |
179 | 181 |
180 bool PermissionUpdateInfoBarDelegate::Cancel() { | 182 bool PermissionUpdateInfoBarDelegate::Cancel() { |
181 base::ResetAndReturn(&callback_).Run(false); | 183 base::ResetAndReturn(&callback_).Run(false); |
182 return true; | 184 return true; |
183 } | 185 } |
184 | 186 |
185 void PermissionUpdateInfoBarDelegate::InfoBarDismissed() { | 187 void PermissionUpdateInfoBarDelegate::InfoBarDismissed() { |
186 base::ResetAndReturn(&callback_).Run(false); | 188 base::ResetAndReturn(&callback_).Run(false); |
187 } | 189 } |
OLD | NEW |