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

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

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: update comments. 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 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/page_info/connection_info_popup_android.h" 5 #include "chrome/browser/ui/android/page_info/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/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/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
16 #include "components/strings/grit/components_strings.h" 16 #include "components/strings/grit/components_strings.h"
17 #include "content/public/browser/browser_context.h" 17 #include "content/public/browser/browser_context.h"
18 #include "content/public/browser/navigation_controller.h" 18 #include "content/public/browser/navigation_controller.h"
19 #include "content/public/browser/navigation_entry.h" 19 #include "content/public/browser/navigation_entry.h"
20 #include "content/public/browser/ssl_status.h" 20 #include "content/public/browser/ssl_status.h"
21 #include "content/public/browser/web_contents.h" 21 #include "content/public/browser/web_contents.h"
22 #include "jni/ConnectionInfoPopup_jni.h" 22 #include "jni/ConnectionInfoPopup_jni.h"
23 #include "net/cert/x509_certificate.h" 23 #include "net/cert/x509_certificate.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 jobject java_website_settings_pop, 81 jobject java_website_settings_pop,
82 WebContents* web_contents) { 82 WebContents* web_contents) {
83 // Important to use GetVisibleEntry to match what's showing in the omnibox. 83 // Important to use GetVisibleEntry to match what's showing in the omnibox.
84 content::NavigationEntry* nav_entry = 84 content::NavigationEntry* nav_entry =
85 web_contents->GetController().GetVisibleEntry(); 85 web_contents->GetController().GetVisibleEntry();
86 if (nav_entry == nullptr) 86 if (nav_entry == nullptr)
87 return; 87 return;
88 88
89 popup_jobject_.Reset(env, java_website_settings_pop); 89 popup_jobject_.Reset(env, java_website_settings_pop);
90 90
91 ChromeSecurityStateModelClient* security_model_client = 91 SecurityStateTabHelper* helper =
92 ChromeSecurityStateModelClient::FromWebContents(web_contents); 92 SecurityStateTabHelper::FromWebContents(web_contents);
93 DCHECK(security_model_client); 93 DCHECK(helper);
94 94
95 security_state::SecurityStateModel::SecurityInfo security_info; 95 security_state::SecurityStateModel::SecurityInfo security_info;
96 security_model_client->GetSecurityInfo(&security_info); 96 helper->GetSecurityInfo(&security_info);
97 97
98 presenter_.reset(new WebsiteSettings( 98 presenter_.reset(new WebsiteSettings(
99 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), 99 this, Profile::FromBrowserContext(web_contents->GetBrowserContext()),
100 TabSpecificContentSettings::FromWebContents(web_contents), web_contents, 100 TabSpecificContentSettings::FromWebContents(web_contents), web_contents,
101 nav_entry->GetURL(), security_info)); 101 nav_entry->GetURL(), security_info));
102 } 102 }
103 103
104 ConnectionInfoPopupAndroid::~ConnectionInfoPopupAndroid() { 104 ConnectionInfoPopupAndroid::~ConnectionInfoPopupAndroid() {
105 } 105 }
106 106
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // There's no tab UI on Android - only connection info is shown. 193 // There's no tab UI on Android - only connection info is shown.
194 NOTIMPLEMENTED(); 194 NOTIMPLEMENTED();
195 } 195 }
196 196
197 // static 197 // static
198 bool 198 bool
199 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid( 199 ConnectionInfoPopupAndroid::RegisterConnectionInfoPopupAndroid(
200 JNIEnv* env) { 200 JNIEnv* env) {
201 return RegisterNativesImpl(env); 201 return RegisterNativesImpl(env);
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698