Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1206)

Side by Side Diff: chrome/browser/password_manager/password_generation_manager.cc

Issue 147533005: [Password Generation] Update UI to match final mocks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replace_password_generation_ui
Patch Set: Unittests Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/password_manager/password_manager_client.h" 8 #include "chrome/browser/password_manager/password_manager_client.h"
9 #include "chrome/browser/password_manager/password_manager_driver.h" 9 #include "chrome/browser/password_manager/password_manager_driver.h"
10 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h " 10 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h "
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 popup_controller_ = 106 popup_controller_ =
107 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate( 107 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate(
108 popup_controller_, 108 popup_controller_,
109 element_bounds_in_screen_space, 109 element_bounds_in_screen_space,
110 form, 110 form,
111 password_generator_.get(), 111 password_generator_.get(),
112 driver_->GetPasswordManager(), 112 driver_->GetPasswordManager(),
113 observer_, 113 observer_,
114 web_contents_, 114 web_contents_,
115 web_contents_->GetView()->GetNativeView()); 115 web_contents_->GetView()->GetNativeView());
116 popup_controller_->Show(); 116 popup_controller_->Show(true /* display_password */);
117 #endif // #if defined(USE_AURA) 117 #endif // #if defined(USE_AURA)
118 } 118 }
119 119
120 void PasswordGenerationManager::OnShowPasswordEditingPopup( 120 void PasswordGenerationManager::OnShowPasswordEditingPopup(
121 const gfx::RectF& bounds) { 121 const gfx::RectF& bounds,
122 // TODO(gcasto): Enable this. 122 const autofill::PasswordForm& form) {
123 // Only implemented for Aura right now.
124 #if defined(USE_AURA)
125 gfx::RectF element_bounds_in_screen_space = GetBoundsInScreenSpace(bounds);
126
127 popup_controller_ =
128 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate(
129 popup_controller_,
130 element_bounds_in_screen_space,
131 form,
132 password_generator_.get(),
133 driver_->GetPasswordManager(),
134 observer_,
135 web_contents_,
136 web_contents_->GetView()->GetNativeView());
137 popup_controller_->Show(false /* display_password */);
138 #endif // #if defined(USE_AURA)
123 } 139 }
124 140
125 void PasswordGenerationManager::OnHidePasswordGenerationPopup() { 141 void PasswordGenerationManager::OnHidePasswordGenerationPopup() {
126 HidePopup(); 142 HidePopup();
127 } 143 }
128 144
129 void PasswordGenerationManager::HidePopup() { 145 void PasswordGenerationManager::HidePopup() {
130 if (popup_controller_) 146 if (popup_controller_)
131 popup_controller_->HideAndDestroy(); 147 popup_controller_->HideAndDestroy();
132 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698