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/website_settings_popup_android.h" | 5 #include "chrome/browser/ui/android/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 "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ssl/chrome_security_state_model_delegate.h" |
12 #include "chrome/browser/ui/website_settings/website_settings.h" | 13 #include "chrome/browser/ui/website_settings/website_settings.h" |
13 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 14 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
14 #include "components/content_settings/core/common/content_settings.h" | 15 #include "components/content_settings/core/common/content_settings.h" |
15 #include "components/content_settings/core/common/content_settings_types.h" | 16 #include "components/content_settings/core/common/content_settings_types.h" |
16 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
17 #include "content/public/browser/cert_store.h" | 18 #include "content/public/browser/cert_store.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/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
21 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
(...skipping 22 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 SecurityStateModel* security_model = | 55 ChromeSecurityStateModelDelegate* security_model_delegate = |
55 SecurityStateModel::FromWebContents(web_contents); | 56 ChromeSecurityStateModelDelegate::FromWebContents(web_contents); |
56 DCHECK(security_model); | 57 DCHECK(security_model_delegate); |
57 | 58 |
58 presenter_.reset(new WebsiteSettings( | 59 presenter_.reset(new WebsiteSettings( |
59 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), | 60 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), |
60 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, | 61 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, |
61 nav_entry->GetURL(), security_model->GetSecurityInfo(), | 62 nav_entry->GetURL(), security_model_delegate->GetSecurityInfo(), |
62 content::CertStore::GetInstance())); | 63 content::CertStore::GetInstance())); |
63 } | 64 } |
64 | 65 |
65 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} | 66 WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {} |
66 | 67 |
67 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, jobject obj) { | 68 void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env, jobject obj) { |
68 delete this; | 69 delete this; |
69 } | 70 } |
70 | 71 |
71 void WebsiteSettingsPopupAndroid::OnPermissionSettingChanged(JNIEnv* env, | 72 void WebsiteSettingsPopupAndroid::OnPermissionSettingChanged(JNIEnv* env, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 WebsiteSettingsUI::TabId tab_id) { | 138 WebsiteSettingsUI::TabId tab_id) { |
138 // There's no tab UI on Android - only connection info is shown. | 139 // There's no tab UI on Android - only connection info is shown. |
139 NOTIMPLEMENTED(); | 140 NOTIMPLEMENTED(); |
140 } | 141 } |
141 | 142 |
142 // static | 143 // static |
143 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( | 144 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( |
144 JNIEnv* env) { | 145 JNIEnv* env) { |
145 return RegisterNativesImpl(env); | 146 return RegisterNativesImpl(env); |
146 } | 147 } |
OLD | NEW |