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

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

Issue 2650033004: Show Page Info from Form-Not-Secure 'Learn more' link (Closed)
Patch Set: Remove the 'trigger a call to open the url' references Created 3 years, 11 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "chrome/browser/infobars/infobar_service.h" 55 #include "chrome/browser/infobars/infobar_service.h"
56 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" 56 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h"
57 #include "chrome/browser/ui/android/infobars/autofill_credit_card_filling_infoba r.h" 57 #include "chrome/browser/ui/android/infobars/autofill_credit_card_filling_infoba r.h"
58 #include "components/autofill/core/browser/autofill_credit_card_filling_infobar_ delegate_mobile.h" 58 #include "components/autofill/core/browser/autofill_credit_card_filling_infobar_ delegate_mobile.h"
59 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m obile.h" 59 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m obile.h"
60 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h" 60 #include "components/autofill/core/browser/autofill_save_card_infobar_mobile.h"
61 #include "components/infobars/core/infobar.h" 61 #include "components/infobars/core/infobar.h"
62 #include "content/public/browser/android/content_view_core.h" 62 #include "content/public/browser/android/content_view_core.h"
63 #else // !OS_ANDROID 63 #else // !OS_ANDROID
64 #include "chrome/browser/ui/browser.h" 64 #include "chrome/browser/ui/browser.h"
65 #include "chrome/browser/ui/browser_commands.h"
65 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" 66 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
66 #include "components/zoom/zoom_controller.h" 67 #include "components/zoom/zoom_controller.h"
67 #endif 68 #endif
68 69
69 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); 70 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient);
70 71
71 namespace autofill { 72 namespace autofill {
72 73
73 namespace {
74
75 const char kSecurityIndicatorHelpCenterUrl[] =
76 "https://support.google.com/chrome/answer/95617";
77
78 } // anonymous namespace
79
80 ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) 74 ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents)
81 : content::WebContentsObserver(web_contents), 75 : content::WebContentsObserver(web_contents),
82 unmask_controller_( 76 unmask_controller_(
83 user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()), 77 user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()),
84 Profile::FromBrowserContext(web_contents->GetBrowserContext()) 78 Profile::FromBrowserContext(web_contents->GetBrowserContext())
85 ->IsOffTheRecord()) { 79 ->IsOffTheRecord()) {
86 DCHECK(web_contents); 80 DCHECK(web_contents);
87 81
88 #if !defined(OS_ANDROID) 82 #if !defined(OS_ANDROID)
89 // Since ZoomController is also a WebContentsObserver, we need to be careful 83 // Since ZoomController is also a WebContentsObserver, we need to be careful
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 chrome::FindBrowserWithWebContents(web_contents()) 382 chrome::FindBrowserWithWebContents(web_contents())
389 ->window() 383 ->window()
390 ->ShowAvatarBubbleFromAvatarButton( 384 ->ShowAvatarBubbleFromAvatarButton(
391 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, 385 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN,
392 signin::ManageAccountsParams(), 386 signin::ManageAccountsParams(),
393 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); 387 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN);
394 #endif 388 #endif
395 } 389 }
396 390
397 void ChromeAutofillClient::ShowHttpNotSecureExplanation() { 391 void ChromeAutofillClient::ShowHttpNotSecureExplanation() {
392 #if !defined(OS_ANDROID)
393 // On desktop platform, open Page Info, which briefly explains the HTTP
394 // warning message and provides a link to the Help Center for more details.
395 if (chrome::ShowWebsiteSettings(
Mathieu 2017/01/25 17:03:41 nit: do we need the if and return, given we are ef
estark 2017/01/25 17:23:15 Fixed the fallthrough and added comment. This is s
396 chrome::FindBrowserWithWebContents(web_contents()), web_contents())) {
Mathieu 2017/01/25 17:03:41 nit: if seems to be good practice (at least in thi
estark 2017/01/25 17:23:15 Done.
397 return;
398 }
399 #else
400 // On Android, where Page Info does not (yet) contain a link to the Help
401 // Center (https://crbug.com/679532), or in corner cases where Page Info is
402 // not shown (for example, no navigation entry), just launch the Help topic
403 // directly.
404 const GURL kSecurityIndicatorHelpCenterUrl(
405 "https://support.google.com/chrome/?p=ui_security_indicator");
398 web_contents()->OpenURL(content::OpenURLParams( 406 web_contents()->OpenURL(content::OpenURLParams(
399 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), 407 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(),
400 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, 408 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
401 false /* is_renderer_initiated */)); 409 false /* is_renderer_initiated */));
410 #endif
402 } 411 }
403 412
404 } // namespace autofill 413 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698