| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/page_info/website_settings_popup_android.h" | 5 #include "chrome/browser/ui/android/page_info/website_settings_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 "base/stl_util.h" | 10 #include "base/stl_util.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/browser/ui/website_settings/website_settings_ui.h" | 15 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 16 #include "components/content_settings/core/common/content_settings.h" | 16 #include "components/content_settings/core/common/content_settings.h" |
| 17 #include "components/content_settings/core/common/content_settings_types.h" | 17 #include "components/content_settings/core/common/content_settings_types.h" |
| 18 #include "components/security_state/core/security_state.h" |
| 18 #include "content/public/browser/browser_context.h" | 19 #include "content/public/browser/browser_context.h" |
| 19 #include "content/public/browser/navigation_controller.h" | 20 #include "content/public/browser/navigation_controller.h" |
| 20 #include "content/public/browser/navigation_entry.h" | 21 #include "content/public/browser/navigation_entry.h" |
| 21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 22 #include "jni/WebsiteSettingsPopup_jni.h" | 23 #include "jni/WebsiteSettingsPopup_jni.h" |
| 23 | 24 |
| 24 using base::android::ConvertUTF16ToJavaString; | 25 using base::android::ConvertUTF16ToJavaString; |
| 25 using base::android::ConvertUTF8ToJavaString; | 26 using base::android::ConvertUTF8ToJavaString; |
| 26 using base::android::JavaParamRef; | 27 using base::android::JavaParamRef; |
| 27 | 28 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 44 // Important to use GetVisibleEntry to match what's showing in the omnibox. | 45 // Important to use GetVisibleEntry to match what's showing in the omnibox. |
| 45 content::NavigationEntry* nav_entry = | 46 content::NavigationEntry* nav_entry = |
| 46 web_contents->GetController().GetVisibleEntry(); | 47 web_contents->GetController().GetVisibleEntry(); |
| 47 if (nav_entry == NULL) | 48 if (nav_entry == NULL) |
| 48 return; | 49 return; |
| 49 | 50 |
| 50 url_ = nav_entry->GetURL(); | 51 url_ = nav_entry->GetURL(); |
| 51 | 52 |
| 52 popup_jobject_.Reset(env, java_website_settings_pop); | 53 popup_jobject_.Reset(env, java_website_settings_pop); |
| 53 | 54 |
| 54 ChromeSecurityStateModelClient* security_model_client = | 55 SecurityStateTabHelper* helper = |
| 55 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 56 SecurityStateTabHelper::FromWebContents(web_contents); |
| 56 DCHECK(security_model_client); | 57 DCHECK(helper); |
| 57 security_state::SecurityStateModel::SecurityInfo security_info; | 58 security_state::SecurityInfo security_info; |
| 58 security_model_client->GetSecurityInfo(&security_info); | 59 helper->GetSecurityInfo(&security_info); |
| 59 | 60 |
| 60 presenter_.reset(new WebsiteSettings( | 61 presenter_.reset(new WebsiteSettings( |
| 61 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 62 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
| 62 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, | 63 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, |
| 63 nav_entry->GetURL(), security_info)); | 64 nav_entry->GetURL(), security_info)); |
| 64 } | 65 } |
| 65 | 66 |
| 66 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} | 67 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} |
| 67 | 68 |
| 68 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, | 69 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 WebsiteSettingsUI::TabId tab_id) { | 147 WebsiteSettingsUI::TabId tab_id) { |
| 147 // There's no tab UI on Android - only connection info is shown. | 148 // There's no tab UI on Android - only connection info is shown. |
| 148 NOTIMPLEMENTED(); | 149 NOTIMPLEMENTED(); |
| 149 } | 150 } |
| 150 | 151 |
| 151 // static | 152 // static |
| 152 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( | 153 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( |
| 153 JNIEnv* env) { | 154 JNIEnv* env) { |
| 154 return RegisterNativesImpl(env); | 155 return RegisterNativesImpl(env); |
| 155 } | 156 } |
| OLD | NEW |