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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
11 #include "chrome/browser/password_manager/password_store_factory.h" | 11 #include "chrome/browser/password_manager/password_store_factory.h" |
12 #include "chrome/browser/ui/browser_command_controller.h" | 12 #include "chrome/browser/ui/browser_command_controller.h" |
13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
14 #include "chrome/browser/ui/browser_navigator_params.h" | 14 #include "chrome/browser/ui/browser_navigator_params.h" |
15 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
16 #include "chrome/browser/ui/chrome_pages.h" | 16 #include "chrome/browser/ui/chrome_pages.h" |
17 #include "chrome/browser/ui/location_bar/location_bar.h" | 17 #include "chrome/browser/ui/location_bar/location_bar.h" |
18 #include "chrome/browser/ui/tab_dialogs.h" | 18 #include "chrome/browser/ui/tab_dialogs.h" |
19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
20 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
21 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" | 21 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" |
22 #include "components/password_manager/core/browser/password_bubble_experiment.h" | 22 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
23 #include "components/password_manager/core/browser/password_form_manager.h" | 23 #include "components/password_manager/core/browser/password_form_manager.h" |
| 24 #include "components/password_manager/core/browser/password_manager_constants.h" |
24 #include "components/password_manager/core/browser/statistics_table.h" | 25 #include "components/password_manager/core/browser/statistics_table.h" |
25 #include "components/password_manager/core/common/credential_manager_types.h" | 26 #include "components/password_manager/core/common/credential_manager_types.h" |
26 #include "content/public/browser/navigation_details.h" | 27 #include "content/public/browser/navigation_details.h" |
27 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
28 | 29 |
29 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
30 #include "chrome/browser/android/chrome_application.h" | 31 #include "chrome/browser/android/chrome_application.h" |
31 #include "chrome/browser/infobars/infobar_service.h" | 32 #include "chrome/browser/infobars/infobar_service.h" |
32 #include "chrome/browser/password_manager/account_chooser_dialog_android.h" | 33 #include "chrome/browser/password_manager/account_chooser_dialog_android.h" |
33 #else | 34 #else |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 password_manager::CredentialType credential_type) { | 297 password_manager::CredentialType credential_type) { |
297 passwords_data_.ChooseCredential(form, credential_type); | 298 passwords_data_.ChooseCredential(form, credential_type); |
298 } | 299 } |
299 | 300 |
300 void ManagePasswordsUIController::NavigateToExternalPasswordManager() { | 301 void ManagePasswordsUIController::NavigateToExternalPasswordManager() { |
301 #if defined(OS_ANDROID) | 302 #if defined(OS_ANDROID) |
302 NOTREACHED(); | 303 NOTREACHED(); |
303 #else | 304 #else |
304 chrome::NavigateParams params( | 305 chrome::NavigateParams params( |
305 chrome::FindBrowserWithWebContents(web_contents()), | 306 chrome::FindBrowserWithWebContents(web_contents()), |
306 GURL(chrome::kPasswordManagerAccountDashboardURL), | 307 GURL(password_manager::kPasswordManagerAccountDashboardURL), |
307 ui::PAGE_TRANSITION_LINK); | 308 ui::PAGE_TRANSITION_LINK); |
308 params.disposition = NEW_FOREGROUND_TAB; | 309 params.disposition = NEW_FOREGROUND_TAB; |
309 chrome::Navigate(¶ms); | 310 chrome::Navigate(¶ms); |
310 #endif | |
311 } | |
312 | |
313 void ManagePasswordsUIController::NavigateToSmartLockPage() { | |
314 #if defined(OS_ANDROID) | |
315 NOTREACHED(); | |
316 #else | |
317 chrome::NavigateParams params( | |
318 chrome::FindBrowserWithWebContents(web_contents()), | |
319 GURL(l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK_PAGE)), | |
320 ui::PAGE_TRANSITION_LINK); | |
321 params.disposition = NEW_FOREGROUND_TAB; | |
322 chrome::Navigate(¶ms); | |
323 #endif | 311 #endif |
324 } | 312 } |
325 | 313 |
326 void ManagePasswordsUIController::NavigateToSmartLockHelpPage() { | 314 void ManagePasswordsUIController::NavigateToSmartLockHelpPage() { |
327 #if defined(OS_ANDROID) | 315 #if defined(OS_ANDROID) |
328 NOTREACHED(); | 316 NOTREACHED(); |
329 #else | 317 #else |
330 chrome::NavigateParams params( | 318 chrome::NavigateParams params( |
331 chrome::FindBrowserWithWebContents(web_contents()), | 319 chrome::FindBrowserWithWebContents(web_contents()), |
332 GURL(chrome::kSmartLockHelpPage), ui::PAGE_TRANSITION_LINK); | 320 GURL(chrome::kSmartLockHelpPage), ui::PAGE_TRANSITION_LINK); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 411 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
424 #endif | 412 #endif |
425 } | 413 } |
426 | 414 |
427 void ManagePasswordsUIController::WebContentsDestroyed() { | 415 void ManagePasswordsUIController::WebContentsDestroyed() { |
428 password_manager::PasswordStore* password_store = | 416 password_manager::PasswordStore* password_store = |
429 GetPasswordStore(web_contents()); | 417 GetPasswordStore(web_contents()); |
430 if (password_store) | 418 if (password_store) |
431 password_store->RemoveObserver(this); | 419 password_store->RemoveObserver(this); |
432 } | 420 } |
OLD | NEW |