| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/password_manager/password_generation_manager.h" | 5 #include "chrome/browser/password_manager/password_generation_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/password_manager/password_manager.h" | 7 #include "chrome/browser/password_manager/password_manager.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/profile_sync_service.h" | 9 #include "chrome/browser/sync/profile_sync_service.h" |
| 10 #include "chrome/browser/sync/profile_sync_service_factory.h" | 10 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 popup_controller_ = | 137 popup_controller_ = |
| 138 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate( | 138 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate( |
| 139 popup_controller_, | 139 popup_controller_, |
| 140 element_bounds_in_screen_space, | 140 element_bounds_in_screen_space, |
| 141 form, | 141 form, |
| 142 password_generator_.get(), | 142 password_generator_.get(), |
| 143 PasswordManager::FromWebContents(web_contents()), | 143 PasswordManager::FromWebContents(web_contents()), |
| 144 observer_, | 144 observer_, |
| 145 web_contents(), | 145 web_contents(), |
| 146 web_contents()->GetView()->GetNativeView()); | 146 web_contents()->GetView()->GetNativeView()); |
| 147 popup_controller_->Show(); | 147 popup_controller_->Show(true /* display_password */); |
| 148 #endif // #if defined(USE_AURA) | 148 #endif // #if defined(USE_AURA) |
| 149 } | 149 } |
| 150 | 150 |
| 151 void PasswordGenerationManager::OnShowPasswordEditingPopup( | 151 void PasswordGenerationManager::OnShowPasswordEditingPopup( |
| 152 const gfx::RectF& bounds) { | 152 const gfx::RectF& bounds) { |
| 153 // TODO(gcasto): Enable this. | 153 // Only implemented for Aura right now. |
| 154 #if defined(USE_AURA) |
| 155 gfx::RectF element_bounds_in_screen_space = GetBoundsInScreenSpace(bounds); |
| 156 |
| 157 popup_controller_ = |
| 158 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate( |
| 159 popup_controller_, |
| 160 element_bounds_in_screen_space, |
| 161 NULL, |
| 162 NULL, |
| 163 NULL, |
| 164 observer_, |
| 165 web_contents(), |
| 166 web_contents()->GetView()->GetNativeView()); |
| 167 popup_controller_->Show(false /* display_password */); |
| 168 #endif // #if defined(USE_AURA) |
| 154 } | 169 } |
| 155 | 170 |
| 156 void PasswordGenerationManager::OnHidePasswordGenerationPopup() { | 171 void PasswordGenerationManager::OnHidePasswordGenerationPopup() { |
| 157 HidePopup(); | 172 HidePopup(); |
| 158 } | 173 } |
| 159 | 174 |
| 160 void PasswordGenerationManager::HidePopup() { | 175 void PasswordGenerationManager::HidePopup() { |
| 161 if (popup_controller_) | 176 if (popup_controller_) |
| 162 popup_controller_->HideAndDestroy(); | 177 popup_controller_->HideAndDestroy(); |
| 163 } | 178 } |
| OLD | NEW |