| 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 "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/password_manager/password_store_factory.h" | 10 #include "chrome/browser/password_manager/password_store_factory.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 NavigateToPasswordManagerSettingsPage() { | 160 NavigateToPasswordManagerSettingsPage() { |
| 161 // TODO(mkwst): chrome_pages.h is compiled out of Android. Need to figure out | 161 // TODO(mkwst): chrome_pages.h is compiled out of Android. Need to figure out |
| 162 // how this navigation should work there. | 162 // how this navigation should work there. |
| 163 #if !defined(OS_ANDROID) | 163 #if !defined(OS_ANDROID) |
| 164 chrome::ShowSettingsSubPage( | 164 chrome::ShowSettingsSubPage( |
| 165 chrome::FindBrowserWithWebContents(web_contents()), | 165 chrome::FindBrowserWithWebContents(web_contents()), |
| 166 chrome::kPasswordManagerSubPage); | 166 chrome::kPasswordManagerSubPage); |
| 167 #endif | 167 #endif |
| 168 } | 168 } |
| 169 | 169 |
| 170 void ManagePasswordsUIController::NavigateToAccountCentralManagementPage() { | |
| 171 // TODO(gcasto): FindBowserWithWebContents() doesn't exist on Android. | |
| 172 // Need to determine how this should work there. | |
| 173 #if !defined(OS_ANDROID) | |
| 174 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | |
| 175 content::OpenURLParams params( | |
| 176 GURL(chrome::kAutoPasswordGenerationLearnMoreURL), content::Referrer(), | |
| 177 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false); | |
| 178 browser->OpenURL(params); | |
| 179 #endif | |
| 180 } | |
| 181 | |
| 182 void ManagePasswordsUIController::SavePassword() { | 170 void ManagePasswordsUIController::SavePassword() { |
| 183 DCHECK(PasswordPendingUserDecision()); | 171 DCHECK(PasswordPendingUserDecision()); |
| 184 SavePasswordInternal(); | 172 SavePasswordInternal(); |
| 185 state_ = password_manager::ui::MANAGE_STATE; | 173 state_ = password_manager::ui::MANAGE_STATE; |
| 186 UpdateBubbleAndIconVisibility(); | 174 UpdateBubbleAndIconVisibility(); |
| 187 } | 175 } |
| 188 | 176 |
| 189 void ManagePasswordsUIController::SavePasswordInternal() { | 177 void ManagePasswordsUIController::SavePasswordInternal() { |
| 190 DCHECK(form_manager_.get()); | 178 DCHECK(form_manager_.get()); |
| 191 form_manager_->Save(); | 179 form_manager_->Save(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 return; | 266 return; |
| 279 CommandUpdater* updater = browser->command_controller()->command_updater(); | 267 CommandUpdater* updater = browser->command_controller()->command_updater(); |
| 280 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 268 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
| 281 #endif | 269 #endif |
| 282 } | 270 } |
| 283 | 271 |
| 284 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { | 272 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { |
| 285 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || | 273 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || |
| 286 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; | 274 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; |
| 287 } | 275 } |
| OLD | NEW |