| 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/connection_info_popup_android.h" |    5 #include "chrome/browser/ui/android/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/ui/website_settings/website_settings.h" |   14 #include "chrome/browser/ui/website_settings/website_settings.h" | 
|   14 #include "chrome/grit/generated_resources.h" |   15 #include "chrome/grit/generated_resources.h" | 
|   15 #include "content/public/browser/browser_context.h" |   16 #include "content/public/browser/browser_context.h" | 
|   16 #include "content/public/browser/cert_store.h" |   17 #include "content/public/browser/cert_store.h" | 
|   17 #include "content/public/browser/navigation_controller.h" |   18 #include "content/public/browser/navigation_controller.h" | 
|   18 #include "content/public/browser/navigation_entry.h" |   19 #include "content/public/browser/navigation_entry.h" | 
|   19 #include "content/public/browser/web_contents.h" |   20 #include "content/public/browser/web_contents.h" | 
|   20 #include "content/public/common/ssl_status.h" |   21 #include "content/public/common/ssl_status.h" | 
|   21 #include "jni/ConnectionInfoPopup_jni.h" |   22 #include "jni/ConnectionInfoPopup_jni.h" | 
|   22 #include "net/cert/x509_certificate.h" |   23 #include "net/cert/x509_certificate.h" | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   83     jobject java_website_settings_pop, |   84     jobject java_website_settings_pop, | 
|   84     WebContents* web_contents) { |   85     WebContents* web_contents) { | 
|   85   // Important to use GetVisibleEntry to match what's showing in the omnibox. |   86   // Important to use GetVisibleEntry to match what's showing in the omnibox. | 
|   86   content::NavigationEntry* nav_entry = |   87   content::NavigationEntry* nav_entry = | 
|   87       web_contents->GetController().GetVisibleEntry(); |   88       web_contents->GetController().GetVisibleEntry(); | 
|   88   if (nav_entry == NULL) |   89   if (nav_entry == NULL) | 
|   89     return; |   90     return; | 
|   90  |   91  | 
|   91   popup_jobject_.Reset(env, java_website_settings_pop); |   92   popup_jobject_.Reset(env, java_website_settings_pop); | 
|   92  |   93  | 
|   93   SecurityStateModel* security_model = |   94   ChromeSecurityStateModelClient* security_model_client = | 
|   94       SecurityStateModel::FromWebContents(web_contents); |   95       ChromeSecurityStateModelClient::FromWebContents(web_contents); | 
|   95   DCHECK(security_model); |   96   DCHECK(security_model_client); | 
|   96  |   97  | 
|   97   presenter_.reset(new WebsiteSettings( |   98   presenter_.reset(new WebsiteSettings( | 
|   98       this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), |   99       this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 
|   99       TabSpecificContentSettings::FromWebContents(web_contents), web_contents, |  100       TabSpecificContentSettings::FromWebContents(web_contents), web_contents, | 
|  100       nav_entry->GetURL(), security_model->GetSecurityInfo(), |  101       nav_entry->GetURL(), security_model_client->GetSecurityInfo(), | 
|  101       content::CertStore::GetInstance())); |  102       content::CertStore::GetInstance())); | 
|  102 } |  103 } | 
|  103  |  104  | 
|  104 ConnectionInfoPopupAndroid::~ConnectionInfoPopupAndroid() { |  105 ConnectionInfoPopupAndroid::~ConnectionInfoPopupAndroid() { | 
|  105 } |  106 } | 
|  106  |  107  | 
|  107 void ConnectionInfoPopupAndroid::Destroy(JNIEnv* env, jobject obj) { |  108 void ConnectionInfoPopupAndroid::Destroy(JNIEnv* env, jobject obj) { | 
|  108   delete this; |  109   delete this; | 
|  109 } |  110 } | 
|  110  |  111  | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  189   // There's no tab UI on Android - only connection info is shown. |  190   // There's no tab UI on Android - only connection info is shown. | 
|  190   NOTIMPLEMENTED(); |  191   NOTIMPLEMENTED(); | 
|  191 } |  192 } | 
|  192  |  193  | 
|  193 // static |  194 // static | 
|  194 bool |  195 bool | 
|  195 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( |  196 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( | 
|  196     JNIEnv* env) { |  197     JNIEnv* env) { | 
|  197   return RegisterNativesImpl(env); |  198   return RegisterNativesImpl(env); | 
|  198 } |  199 } | 
| OLD | NEW |