| 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" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 void ManagePasswordsUIController::OnLoginsChanged( | 154 void ManagePasswordsUIController::OnLoginsChanged( |
| 155 const password_manager::PasswordStoreChangeList& changes) { | 155 const password_manager::PasswordStoreChangeList& changes) { |
| 156 password_manager::ui::State current_state = state(); | 156 password_manager::ui::State current_state = state(); |
| 157 passwords_data_.ProcessLoginsChanged(changes); | 157 passwords_data_.ProcessLoginsChanged(changes); |
| 158 if (current_state != state()) | 158 if (current_state != state()) |
| 159 UpdateBubbleAndIconVisibility(); | 159 UpdateBubbleAndIconVisibility(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void ManagePasswordsUIController:: | 162 void ManagePasswordsUIController::NavigateToPasswordManagerSettingsPage() { |
| 163 NavigateToPasswordManagerSettingsPage() { | |
| 164 #if defined(OS_ANDROID) | 163 #if defined(OS_ANDROID) |
| 165 chrome::android::ChromiumApplication::ShowPasswordSettings(); | 164 chrome::android::ChromiumApplication::ShowPasswordSettings(); |
| 166 #else | 165 #else |
| 167 chrome::ShowSettingsSubPage( | 166 chrome::ShowSettingsSubPage( |
| 168 chrome::FindBrowserWithWebContents(web_contents()), | 167 chrome::FindBrowserWithWebContents(web_contents()), |
| 169 chrome::kPasswordManagerSubPage); | 168 chrome::kPasswordManagerSubPage); |
| 170 #endif | 169 #endif |
| 171 } | 170 } |
| 172 | 171 |
| 172 void ManagePasswordsUIController::NavigateToExternalPasswordManager() { |
| 173 #if defined(OS_ANDROID) |
| 174 NOTREACHED(); |
| 175 #else |
| 176 chrome::NavigateParams params( |
| 177 chrome::FindBrowserWithWebContents(web_contents()), |
| 178 GURL(chrome::kPasswordManagerAccountDashboardURL), |
| 179 ui::PAGE_TRANSITION_LINK); |
| 180 params.disposition = NEW_FOREGROUND_TAB; |
| 181 chrome::Navigate(¶ms); |
| 182 #endif |
| 183 } |
| 184 |
| 173 void ManagePasswordsUIController::NavigateToSmartLockHelpArticle() { | 185 void ManagePasswordsUIController::NavigateToSmartLockHelpArticle() { |
| 174 #if defined(OS_ANDROID) | 186 #if defined(OS_ANDROID) |
| 175 NOTREACHED(); | 187 NOTREACHED(); |
| 176 #else | 188 #else |
| 177 chrome::NavigateParams params( | 189 chrome::NavigateParams params( |
| 178 chrome::FindBrowserWithWebContents(web_contents()), | 190 chrome::FindBrowserWithWebContents(web_contents()), |
| 179 GURL(l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK_ARTICLE)), | 191 GURL(l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK_ARTICLE)), |
| 180 ui::PAGE_TRANSITION_LINK); | 192 ui::PAGE_TRANSITION_LINK); |
| 181 params.disposition = NEW_FOREGROUND_TAB; | 193 params.disposition = NEW_FOREGROUND_TAB; |
| 182 chrome::Navigate(¶ms); | 194 chrome::Navigate(¶ms); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 361 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
| 350 #endif | 362 #endif |
| 351 } | 363 } |
| 352 | 364 |
| 353 void ManagePasswordsUIController::WebContentsDestroyed() { | 365 void ManagePasswordsUIController::WebContentsDestroyed() { |
| 354 password_manager::PasswordStore* password_store = | 366 password_manager::PasswordStore* password_store = |
| 355 GetPasswordStore(web_contents()); | 367 GetPasswordStore(web_contents()); |
| 356 if (password_store) | 368 if (password_store) |
| 357 password_store->RemoveObserver(this); | 369 password_store->RemoveObserver(this); |
| 358 } | 370 } |
| OLD | NEW |