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

Side by Side Diff: chrome/browser/ui/autofill/chrome_autofill_client.cc

Issue 1136473006: Don't autofill credit cards on non-secure pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove debug code Created 5 years, 7 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/autofill/chrome_autofill_client.h" 5 #include "chrome/browser/ui/autofill/chrome_autofill_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" 10 #include "chrome/browser/autofill/personal_data_manager_factory.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/ui/chrome_pages.h" 26 #include "chrome/browser/ui/chrome_pages.h"
27 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
28 #include "chrome/browser/webdata/web_data_service_factory.h" 28 #include "chrome/browser/webdata/web_data_service_factory.h"
29 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
30 #include "components/autofill/content/browser/content_autofill_driver.h" 30 #include "components/autofill/content/browser/content_autofill_driver.h"
31 #include "components/autofill/content/common/autofill_messages.h" 31 #include "components/autofill/content/common/autofill_messages.h"
32 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h" 32 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h"
33 #include "components/autofill/core/common/autofill_pref_names.h" 33 #include "components/autofill/core/common/autofill_pref_names.h"
34 #include "components/password_manager/content/browser/content_password_manager_d river.h" 34 #include "components/password_manager/content/browser/content_password_manager_d river.h"
35 #include "components/user_prefs/user_prefs.h" 35 #include "components/user_prefs/user_prefs.h"
36 #include "content/public/browser/navigation_entry.h"
36 #include "content/public/browser/render_frame_host.h" 37 #include "content/public/browser/render_frame_host.h"
37 #include "ui/gfx/geometry/rect.h" 38 #include "ui/gfx/geometry/rect.h"
38 39
39 #if defined(OS_ANDROID) 40 #if defined(OS_ANDROID)
40 #include "chrome/browser/android/chromium_application.h" 41 #include "chrome/browser/android/chromium_application.h"
41 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" 42 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h"
42 #else 43 #else
43 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 44 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
44 #include "components/ui/zoom/zoom_controller.h" 45 #include "components/ui/zoom/zoom_controller.h"
45 #endif 46 #endif
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 web_contents()->SendToAllFrames( 299 web_contents()->SendToAllFrames(
299 new AutofillMsg_FirstUserGestureObservedInTab(routing_id())); 300 new AutofillMsg_FirstUserGestureObservedInTab(routing_id()));
300 } 301 }
301 302
302 void ChromeAutofillClient::LinkClicked(const GURL& url, 303 void ChromeAutofillClient::LinkClicked(const GURL& url,
303 WindowOpenDisposition disposition) { 304 WindowOpenDisposition disposition) {
304 web_contents()->OpenURL(content::OpenURLParams( 305 web_contents()->OpenURL(content::OpenURLParams(
305 url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false)); 306 url, content::Referrer(), disposition, ui::PAGE_TRANSITION_LINK, false));
306 } 307 }
307 308
309 bool ChromeAutofillClient::IsContextSecure(const GURL& form_origin) {
jww 2015/06/08 18:37:35 It seems bad to introduce this. We have isPrivileg
Evan Stade 2015/06/08 22:41:42 this param is not used
sigbjorn 2015/06/12 11:47:53 It is used in the fallback mechanism. It is not ne
sigbjorn 2015/06/12 11:47:53 isPrivilegedContext seems to only check isPotentia
310 content::SSLStatus ssl_status;
311 content::NavigationEntry* navigation_entry =
312 web_contents()->GetController().GetVisibleEntry();
jww 2015/06/08 18:37:35 This is probably not what we want. We probably wan
313 DCHECK(navigation_entry);
314 if (!navigation_entry)
315 return false;
316
317 ssl_status = navigation_entry->GetSSL();
318 return ssl_status.security_style ==
319 content::SECURITY_STYLE_AUTHENTICATED &&
jww 2015/06/08 18:37:34 We probably shouldn't be using the security style
sigbjorn 2015/06/12 11:47:53 Using the security style is on purpose. The user h
320 ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
321 }
322
308 } // namespace autofill 323 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698