| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "components/infobars/core/infobar.h" | 68 #include "components/infobars/core/infobar.h" |
| 69 #include "content/public/browser/android/content_view_core.h" | 69 #include "content/public/browser/android/content_view_core.h" |
| 70 #else // !OS_ANDROID | 70 #else // !OS_ANDROID |
| 71 #include "chrome/browser/ui/browser.h" | 71 #include "chrome/browser/ui/browser.h" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); | 74 DEFINE_WEB_CONTENTS_USER_DATA_KEY(autofill::ChromeAutofillClient); |
| 75 | 75 |
| 76 namespace autofill { | 76 namespace autofill { |
| 77 | 77 |
| 78 namespace { |
| 79 |
| 80 const char kSecurityIndicatorHelpCenterUrl[] = |
| 81 "https://support.google.com/chrome/answer/95617?hl=en"; |
| 82 |
| 83 } // anonymous namespace |
| 84 |
| 78 ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) | 85 ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) |
| 79 : content::WebContentsObserver(web_contents), | 86 : content::WebContentsObserver(web_contents), |
| 80 unmask_controller_( | 87 unmask_controller_( |
| 81 user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()), | 88 user_prefs::UserPrefs::Get(web_contents->GetBrowserContext()), |
| 82 Profile::FromBrowserContext(web_contents->GetBrowserContext()) | 89 Profile::FromBrowserContext(web_contents->GetBrowserContext()) |
| 83 ->IsOffTheRecord()) { | 90 ->IsOffTheRecord()) { |
| 84 DCHECK(web_contents); | 91 DCHECK(web_contents); |
| 85 | 92 |
| 86 #if !BUILDFLAG(ANDROID_JAVA_UI) | 93 #if !BUILDFLAG(ANDROID_JAVA_UI) |
| 87 // Since ZoomController is also a WebContentsObserver, we need to be careful | 94 // Since ZoomController is also a WebContentsObserver, we need to be careful |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 #else | 392 #else |
| 386 chrome::FindBrowserWithWebContents(web_contents()) | 393 chrome::FindBrowserWithWebContents(web_contents()) |
| 387 ->window() | 394 ->window() |
| 388 ->ShowAvatarBubbleFromAvatarButton( | 395 ->ShowAvatarBubbleFromAvatarButton( |
| 389 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 396 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
| 390 signin::ManageAccountsParams(), | 397 signin::ManageAccountsParams(), |
| 391 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); | 398 signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); |
| 392 #endif | 399 #endif |
| 393 } | 400 } |
| 394 | 401 |
| 402 void ChromeAutofillClient::ShowHttpNotSecureExplanation() { |
| 403 web_contents()->OpenURL(content::OpenURLParams( |
| 404 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), |
| 405 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 406 false /* is_renderer_initiated */)); |
| 407 } |
| 408 |
| 395 } // namespace autofill | 409 } // namespace autofill |
| OLD | NEW |