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

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

Issue 2971783002: Skeleton for showing "Show all saved passwords row" for Linux/CrOs/Windows platforms (Closed)
Patch Set: . Created 3 years, 4 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 14 matching lines...) Expand all
25 #include "chrome/browser/ui/autofill/create_card_unmask_prompt_view.h" 25 #include "chrome/browser/ui/autofill/create_card_unmask_prompt_view.h"
26 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h" 26 #include "chrome/browser/ui/autofill/credit_card_scanner_controller.h"
27 #include "chrome/browser/ui/browser_finder.h" 27 #include "chrome/browser/ui/browser_finder.h"
28 #include "chrome/browser/ui/chrome_pages.h" 28 #include "chrome/browser/ui/chrome_pages.h"
29 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" 29 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
30 #include "chrome/browser/vr/vr_tab_helper.h" 30 #include "chrome/browser/vr/vr_tab_helper.h"
31 #include "chrome/browser/web_data_service_factory.h" 31 #include "chrome/browser/web_data_service_factory.h"
32 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
33 #include "components/autofill/content/browser/content_autofill_driver.h" 33 #include "components/autofill/content/browser/content_autofill_driver.h"
34 #include "components/autofill/content/browser/content_autofill_driver_factory.h" 34 #include "components/autofill/content/browser/content_autofill_driver_factory.h"
35 #include "components/autofill/core/browser/popup_item_ids.h"
35 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" 36 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h"
36 #include "components/autofill/core/common/autofill_pref_names.h" 37 #include "components/autofill/core/common/autofill_pref_names.h"
37 #include "components/autofill/core/common/autofill_switches.h" 38 #include "components/autofill/core/common/autofill_switches.h"
38 #include "components/browser_sync/profile_sync_service.h" 39 #include "components/browser_sync/profile_sync_service.h"
39 #include "components/password_manager/content/browser/content_password_manager_d river.h" 40 #include "components/password_manager/content/browser/content_password_manager_d river.h"
41 #include "components/password_manager/core/browser/password_manager_metrics_util .h"
40 #include "components/prefs/pref_service.h" 42 #include "components/prefs/pref_service.h"
41 #include "components/signin/core/browser/profile_identity_provider.h" 43 #include "components/signin/core/browser/profile_identity_provider.h"
42 #include "components/signin/core/browser/signin_header_helper.h" 44 #include "components/signin/core/browser/signin_header_helper.h"
43 #include "components/signin/core/browser/signin_metrics.h" 45 #include "components/signin/core/browser/signin_metrics.h"
44 #include "components/user_prefs/user_prefs.h" 46 #include "components/user_prefs/user_prefs.h"
45 #include "content/public/browser/navigation_entry.h" 47 #include "content/public/browser/navigation_entry.h"
46 #include "content/public/browser/render_frame_host.h" 48 #include "content/public/browser/render_frame_host.h"
47 #include "content/public/browser/ssl_status.h" 49 #include "content/public/browser/ssl_status.h"
48 #include "ui/gfx/geometry/rect.h" 50 #include "ui/gfx/geometry/rect.h"
49 51
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 367
366 bool ChromeAutofillClient::ShouldShowSigninPromo() { 368 bool ChromeAutofillClient::ShouldShowSigninPromo() {
367 #if !defined(OS_ANDROID) 369 #if !defined(OS_ANDROID)
368 return false; 370 return false;
369 #else 371 #else
370 return signin::ShouldShowPromo( 372 return signin::ShouldShowPromo(
371 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); 373 Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
372 #endif 374 #endif
373 } 375 }
374 376
375 void ChromeAutofillClient::StartSigninFlow() { 377 bool ChromeAutofillClient::ExecuteCommand(int id) {
378 if (id == autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) {
379 password_manager::metrics_util::LogShowedHttpNotSecureExplanation();
vasilii 2017/07/26 12:17:36 You double record this in autofill_external_delega
melandory 2017/07/26 15:01:30 Done.
380 ShowHttpNotSecureExplanation();
381 return true;
382 } else if (id == autofill::POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY) {
vasilii 2017/07/26 12:17:36 no need for "else"
melandory 2017/07/26 15:01:30 Done.
383 #if !defined(OS_ANDROID)
384 chrome::ShowSettingsSubPage(
385 chrome::FindBrowserWithWebContents(web_contents()),
386 chrome::kPasswordManagerSubPage);
387 #endif
388
389 return true;
390 } else if (id == autofill::POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) {
376 #if defined(OS_ANDROID) 391 #if defined(OS_ANDROID)
377 auto* window = web_contents()->GetNativeView()->GetWindowAndroid(); 392 auto* window = web_contents()->GetNativeView()->GetWindowAndroid();
vasilii 2017/07/26 12:17:36 align
melandory 2017/07/26 15:01:30 Done.
378 if (window) { 393 if (window) {
379 chrome::android::SigninPromoUtilAndroid::StartAccountSigninActivityForPromo( 394 chrome::android::SigninPromoUtilAndroid::StartAccountSigninActivityForPromo(
380 window, signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN); 395 window, signin_metrics::AccessPoint::ACCESS_POINT_AUTOFILL_DROPDOWN);
381 } 396 }
382 #endif 397 #endif
398 return true;
399 }
400 return false;
383 } 401 }
384 402
385 void ChromeAutofillClient::ShowHttpNotSecureExplanation() { 403 void ChromeAutofillClient::ShowHttpNotSecureExplanation() {
386 #if !defined(OS_ANDROID) 404 #if !defined(OS_ANDROID)
387 // On desktop platforms, open Page Info, which briefly explains the HTTP 405 // On desktop platforms, open Page Info, which briefly explains the HTTP
388 // warning message and provides a link to the Help Center for more details. 406 // warning message and provides a link to the Help Center for more details.
389 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); 407 Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
390 if (browser && chrome::ShowPageInfo(browser, web_contents())) 408 if (browser && chrome::ShowPageInfo(browser, web_contents()))
391 return; 409 return;
392 // Otherwise fall through to the section below that opens the URL directly. 410 // Otherwise fall through to the section below that opens the URL directly.
(...skipping 13 matching lines...) Expand all
406 424
407 bool ChromeAutofillClient::IsAutofillSupported() { 425 bool ChromeAutofillClient::IsAutofillSupported() {
408 // VR browsing does not support popups at the moment. 426 // VR browsing does not support popups at the moment.
409 if (vr::VrTabHelper::IsInVr(web_contents())) 427 if (vr::VrTabHelper::IsInVr(web_contents()))
410 return false; 428 return false;
411 429
412 return true; 430 return true;
413 } 431 }
414 432
415 } // namespace autofill 433 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698