| 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/passwords/manage_passwords_ui_controller.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| 11 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 11 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 12 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 12 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 13 #include "chrome/browser/password_manager/password_store_factory.h" | 13 #include "chrome/browser/password_manager/password_store_factory.h" |
| 14 #include "chrome/browser/ui/browser_command_controller.h" | 14 #include "chrome/browser/ui/browser_command_controller.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/browser_navigator_params.h" | 16 #include "chrome/browser/ui/browser_navigator_params.h" |
| 17 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
| 18 #include "chrome/browser/ui/chrome_pages.h" | 18 #include "chrome/browser/ui/chrome_pages.h" |
| 19 #include "chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion.h" |
| 20 #include "chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_controll
er.h" |
| 21 #include "chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.h" |
| 19 #include "chrome/browser/ui/location_bar/location_bar.h" | 22 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 20 #include "chrome/browser/ui/passwords/manage_passwords_icon_view.h" | 23 #include "chrome/browser/ui/passwords/manage_passwords_icon_view.h" |
| 21 #include "chrome/browser/ui/passwords/password_dialog_controller_impl.h" | 24 #include "chrome/browser/ui/passwords/password_dialog_controller_impl.h" |
| 22 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" | 25 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" |
| 23 #include "chrome/browser/ui/tab_dialogs.h" | 26 #include "chrome/browser/ui/tab_dialogs.h" |
| 24 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 25 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" | 28 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" |
| 26 #include "components/password_manager/core/browser/password_bubble_experiment.h" | 29 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
| 27 #include "components/password_manager/core/browser/password_form_manager.h" | 30 #include "components/password_manager/core/browser/password_form_manager.h" |
| 28 #include "components/password_manager/core/browser/password_manager_constants.h" | 31 #include "components/password_manager/core/browser/password_manager_constants.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 LocationBar* location_bar = browser->window()->GetLocationBar(); | 396 LocationBar* location_bar = browser->window()->GetLocationBar(); |
| 394 DCHECK(location_bar); | 397 DCHECK(location_bar); |
| 395 location_bar->UpdateManagePasswordsIconAndBubble(); | 398 location_bar->UpdateManagePasswordsIconAndBubble(); |
| 396 } | 399 } |
| 397 | 400 |
| 398 AccountChooserPrompt* ManagePasswordsUIController::CreateAccountChooser( | 401 AccountChooserPrompt* ManagePasswordsUIController::CreateAccountChooser( |
| 399 PasswordDialogController* controller) { | 402 PasswordDialogController* controller) { |
| 400 return CreateAccountChooserPromptView(controller, web_contents()); | 403 return CreateAccountChooserPromptView(controller, web_contents()); |
| 401 } | 404 } |
| 402 | 405 |
| 406 DesktopIOSPromotion* ManagePasswordsUIController::CreateDesktopIOSPromotion() { |
| 407 ios_promotion_controller_.reset(new DesktopIOSPromotionController( |
| 408 Profile::FromBrowserContext(web_contents()->GetBrowserContext()), |
| 409 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); |
| 410 return CreateDesktopIOSPromotionView(ios_promotion_controller_.get()); |
| 411 } |
| 412 |
| 403 AutoSigninFirstRunPrompt* ManagePasswordsUIController::CreateAutoSigninPrompt( | 413 AutoSigninFirstRunPrompt* ManagePasswordsUIController::CreateAutoSigninPrompt( |
| 404 PasswordDialogController* controller) { | 414 PasswordDialogController* controller) { |
| 405 return CreateAutoSigninPromptView(controller, web_contents()); | 415 return CreateAutoSigninPromptView(controller, web_contents()); |
| 406 } | 416 } |
| 407 | 417 |
| 408 bool ManagePasswordsUIController::HasBrowserWindow() const { | 418 bool ManagePasswordsUIController::HasBrowserWindow() const { |
| 409 return chrome::FindBrowserWithWebContents(web_contents()) != nullptr; | 419 return chrome::FindBrowserWithWebContents(web_contents()) != nullptr; |
| 410 } | 420 } |
| 411 | 421 |
| 412 void ManagePasswordsUIController::DidFinishNavigation( | 422 void ManagePasswordsUIController::DidFinishNavigation( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); | 459 passwords_data_.TransitionToState(password_manager::ui::MANAGE_STATE); |
| 450 } | 460 } |
| 451 } | 461 } |
| 452 | 462 |
| 453 void ManagePasswordsUIController::WebContentsDestroyed() { | 463 void ManagePasswordsUIController::WebContentsDestroyed() { |
| 454 password_manager::PasswordStore* password_store = | 464 password_manager::PasswordStore* password_store = |
| 455 GetPasswordStore(web_contents()); | 465 GetPasswordStore(web_contents()); |
| 456 if (password_store) | 466 if (password_store) |
| 457 password_store->RemoveObserver(this); | 467 password_store->RemoveObserver(this); |
| 458 } | 468 } |
| OLD | NEW |