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/ui/android/page_info/connection_info_popup_android.h" | 5 #include "chrome/browser/ui/android/page_info/connection_info_popup_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.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 "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 13 #include "chrome/browser/ssl/security_state_tab_helper.h" |
14 #include "chrome/browser/ui/website_settings/website_settings.h" | 14 #include "chrome/browser/ui/website_settings/website_settings.h" |
15 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
| 16 #include "components/security_state/core/security_state.h" |
16 #include "components/strings/grit/components_strings.h" | 17 #include "components/strings/grit/components_strings.h" |
17 #include "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
18 #include "content/public/browser/navigation_controller.h" | 19 #include "content/public/browser/navigation_controller.h" |
19 #include "content/public/browser/navigation_entry.h" | 20 #include "content/public/browser/navigation_entry.h" |
20 #include "content/public/browser/ssl_status.h" | 21 #include "content/public/browser/ssl_status.h" |
21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
22 #include "jni/ConnectionInfoPopup_jni.h" | 23 #include "jni/ConnectionInfoPopup_jni.h" |
23 #include "net/cert/x509_certificate.h" | 24 #include "net/cert/x509_certificate.h" |
24 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
25 | 26 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 jobject java_website_settings_pop, | 82 jobject java_website_settings_pop, |
82 WebContents* web_contents) { | 83 WebContents* web_contents) { |
83 // Important to use GetVisibleEntry to match what's showing in the omnibox. | 84 // Important to use GetVisibleEntry to match what's showing in the omnibox. |
84 content::NavigationEntry* nav_entry = | 85 content::NavigationEntry* nav_entry = |
85 web_contents->GetController().GetVisibleEntry(); | 86 web_contents->GetController().GetVisibleEntry(); |
86 if (nav_entry == nullptr) | 87 if (nav_entry == nullptr) |
87 return; | 88 return; |
88 | 89 |
89 popup_jobject_.Reset(env, java_website_settings_pop); | 90 popup_jobject_.Reset(env, java_website_settings_pop); |
90 | 91 |
91 ChromeSecurityStateModelClient* security_model_client = | 92 SecurityStateTabHelper* helper = |
92 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 93 SecurityStateTabHelper::FromWebContents(web_contents); |
93 DCHECK(security_model_client); | 94 DCHECK(helper); |
94 | 95 |
95 security_state::SecurityStateModel::SecurityInfo security_info; | 96 security_state::SecurityInfo security_info; |
96 security_model_client->GetSecurityInfo(&security_info); | 97 helper->GetSecurityInfo(&security_info); |
97 | 98 |
98 presenter_.reset(new WebsiteSettings( | 99 presenter_.reset(new WebsiteSettings( |
99 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 100 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
100 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, | 101 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, |
101 nav_entry->GetURL(), security_info)); | 102 nav_entry->GetURL(), security_info)); |
102 } | 103 } |
103 | 104 |
104 ConnectionInfoPopupAndroid::~ConnectionInfoPopupAndroid() { | 105 ConnectionInfoPopupAndroid::~ConnectionInfoPopupAndroid() { |
105 } | 106 } |
106 | 107 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // There's no tab UI on Android - only connection info is shown. | 194 // There's no tab UI on Android - only connection info is shown. |
194 NOTIMPLEMENTED(); | 195 NOTIMPLEMENTED(); |
195 } | 196 } |
196 | 197 |
197 // static | 198 // static |
198 bool | 199 bool |
199 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( | 200 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( |
200 JNIEnv* env) { | 201 JNIEnv* env) { |
201 return RegisterNativesImpl(env); | 202 return RegisterNativesImpl(env); |
202 } | 203 } |
OLD | NEW |