Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: chrome/browser/ui/android/page_info/website_settings_popup_android.cc

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: sync. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 WebsiteSettingsUI::TabId tab_id) { 153 WebsiteSettingsUI::TabId tab_id) {
153 // There's no tab UI on Android - only connection info is shown. 154 // There's no tab UI on Android - only connection info is shown.
154 NOTIMPLEMENTED(); 155 NOTIMPLEMENTED();
155 } 156 }
156 157
157 // static 158 // static
158 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid( 159 bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid(
159 JNIEnv* env) { 160 JNIEnv* env) {
160 return RegisterNativesImpl(env); 161 return RegisterNativesImpl(env);
161 } 162 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698