| 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/chrome_security_state_model.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 "content/public/browser/browser_context.h" | 18 #include "content/public/browser/browser_context.h" |
| 19 #include "content/public/browser/navigation_controller.h" | 19 #include "content/public/browser/navigation_controller.h" |
| 20 #include "content/public/browser/navigation_entry.h" | 20 #include "content/public/browser/navigation_entry.h" |
| 21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "jni/WebsiteSettingsPopup_jni.h" | 22 #include "jni/WebsiteSettingsPopup_jni.h" |
| 23 | 23 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 // Important to use GetVisibleEntry to match what's showing in the omnibox. | 44 // Important to use GetVisibleEntry to match what's showing in the omnibox. |
| 45 content::NavigationEntry* nav_entry = | 45 content::NavigationEntry* nav_entry = |
| 46 web_contents->GetController().GetVisibleEntry(); | 46 web_contents->GetController().GetVisibleEntry(); |
| 47 if (nav_entry == NULL) | 47 if (nav_entry == NULL) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 url_ = nav_entry->GetURL(); | 50 url_ = nav_entry->GetURL(); |
| 51 | 51 |
| 52 popup_jobject_.Reset(env, java_website_settings_pop); | 52 popup_jobject_.Reset(env, java_website_settings_pop); |
| 53 | 53 |
| 54 ChromeSecurityStateModelClient* security_model_client = | 54 ChromeSecurityStateModel* security_model = |
| 55 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 55 ChromeSecurityStateModel::FromWebContents(web_contents); |
| 56 DCHECK(security_model_client); | 56 DCHECK(security_model); |
| 57 security_state::SecurityStateModel::SecurityInfo security_info; | 57 security_state::SecurityStateModel::SecurityInfo security_info; |
| 58 security_model_client->GetSecurityInfo(&security_info); | 58 security_model->GetSecurityInfo(&security_info); |
| 59 | 59 |
| 60 presenter_.reset(new WebsiteSettings( | 60 presenter_.reset(new WebsiteSettings( |
| 61 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 61 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
| 62 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, | 62 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, |
| 63 nav_entry->GetURL(), security_info)); | 63 nav_entry->GetURL(), security_info)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} | 66 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} |
| 67 | 67 |
| 68 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, | 68 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 WebsiteSettingsUI::TabId tab_id) { | 146 WebsiteSettingsUI::TabId tab_id) { |
| 147 // There's no tab UI on Android - only connection info is shown. | 147 // There's no tab UI on Android - only connection info is shown. |
| 148 NOTIMPLEMENTED(); | 148 NOTIMPLEMENTED(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // static | 151 // static |
| 152 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( | 152 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( |
| 153 JNIEnv* env) { | 153 JNIEnv* env) { |
| 154 return RegisterNativesImpl(env); | 154 return RegisterNativesImpl(env); |
| 155 } | 155 } |
| OLD | NEW |