| 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 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 24 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
| 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/web_data_service_factory.h" | 30 #include "chrome/browser/web_data_service_factory.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "components/autofill/content/browser/content_autofill_driver.h" | 32 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 33 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 33 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
| 34 #include "components/autofill/core/browser/popup_item_ids.h" |
| 34 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" | 35 #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" |
| 35 #include "components/autofill/core/common/autofill_pref_names.h" | 36 #include "components/autofill/core/common/autofill_pref_names.h" |
| 36 #include "components/autofill/core/common/autofill_switches.h" | 37 #include "components/autofill/core/common/autofill_switches.h" |
| 37 #include "components/browser_sync/profile_sync_service.h" | 38 #include "components/browser_sync/profile_sync_service.h" |
| 38 #include "components/password_manager/content/browser/content_password_manager_d
river.h" | 39 #include "components/password_manager/content/browser/content_password_manager_d
river.h" |
| 40 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
| 39 #include "components/prefs/pref_service.h" | 41 #include "components/prefs/pref_service.h" |
| 40 #include "components/signin/core/browser/profile_identity_provider.h" | 42 #include "components/signin/core/browser/profile_identity_provider.h" |
| 41 #include "components/signin/core/browser/signin_header_helper.h" | 43 #include "components/signin/core/browser/signin_header_helper.h" |
| 42 #include "components/signin/core/browser/signin_metrics.h" | 44 #include "components/signin/core/browser/signin_metrics.h" |
| 43 #include "components/user_prefs/user_prefs.h" | 45 #include "components/user_prefs/user_prefs.h" |
| 44 #include "content/public/browser/navigation_entry.h" | 46 #include "content/public/browser/navigation_entry.h" |
| 45 #include "content/public/browser/render_frame_host.h" | 47 #include "content/public/browser/render_frame_host.h" |
| 46 #include "content/public/browser/ssl_status.h" | 48 #include "content/public/browser/ssl_status.h" |
| 47 #include "ui/gfx/geometry/rect.h" | 49 #include "ui/gfx/geometry/rect.h" |
| 48 | 50 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // not shown (for example, no navigation entry), just launch the Help topic | 400 // not shown (for example, no navigation entry), just launch the Help topic |
| 399 // directly. | 401 // directly. |
| 400 const GURL kSecurityIndicatorHelpCenterUrl( | 402 const GURL kSecurityIndicatorHelpCenterUrl( |
| 401 "https://support.google.com/chrome/?p=ui_security_indicator"); | 403 "https://support.google.com/chrome/?p=ui_security_indicator"); |
| 402 web_contents()->OpenURL(content::OpenURLParams( | 404 web_contents()->OpenURL(content::OpenURLParams( |
| 403 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), | 405 GURL(kSecurityIndicatorHelpCenterUrl), content::Referrer(), |
| 404 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, | 406 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 405 false /* is_renderer_initiated */)); | 407 false /* is_renderer_initiated */)); |
| 406 } | 408 } |
| 407 | 409 |
| 410 bool ChromeAutofillClient::ExecuteCommand(int id) { |
| 411 if (id == autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) { |
| 412 password_manager::metrics_util::LogShowedHttpNotSecureExplanation(); |
| 413 ShowHttpNotSecureExplanation(); |
| 414 return true; |
| 415 } else if (id == autofill::POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY) { |
| 416 ShowPasswordsSettingsPage(); |
| 417 return true; |
| 418 } |
| 419 return false; |
| 420 } |
| 421 |
| 422 void ChromeAutofillClient::ShowPasswordsSettingsPage() { |
| 423 #if !defined(OS_ANDROID) |
| 424 chrome::ShowSettingsSubPage( |
| 425 chrome::FindBrowserWithWebContents(web_contents()), |
| 426 chrome::kPasswordManagerSubPage); |
| 427 #endif |
| 428 } |
| 429 |
| 408 } // namespace autofill | 430 } // namespace autofill |
| OLD | NEW |