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

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

Issue 267183002: Password manager: Implement password generation UI for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_popup_view_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 gfx::Rect client_area = web_contents()->GetContainerBounds(); 285 gfx::Rect client_area = web_contents()->GetContainerBounds();
286 return bounds + client_area.OffsetFromOrigin(); 286 return bounds + client_area.OffsetFromOrigin();
287 } 287 }
288 288
289 void ChromePasswordManagerClient::ShowPasswordGenerationPopup( 289 void ChromePasswordManagerClient::ShowPasswordGenerationPopup(
290 const gfx::RectF& bounds, 290 const gfx::RectF& bounds,
291 int max_length, 291 int max_length,
292 const autofill::PasswordForm& form) { 292 const autofill::PasswordForm& form) {
293 // TODO(gcasto): Validate data in PasswordForm. 293 // TODO(gcasto): Validate data in PasswordForm.
294 294
295 // Only implemented for Aura right now. 295 // Not yet implemented on other platforms.
296 #if defined(USE_AURA) 296 #if defined(USE_AURA) || defined(OS_MACOSX)
297 gfx::RectF element_bounds_in_screen_space = GetBoundsInScreenSpace(bounds); 297 gfx::RectF element_bounds_in_screen_space = GetBoundsInScreenSpace(bounds);
298 298
299 popup_controller_ = 299 popup_controller_ =
300 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate( 300 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate(
301 popup_controller_, 301 popup_controller_,
302 element_bounds_in_screen_space, 302 element_bounds_in_screen_space,
303 form, 303 form,
304 max_length, 304 max_length,
305 driver_.GetPasswordManager(), 305 driver_.GetPasswordManager(),
306 observer_, 306 observer_,
307 web_contents(), 307 web_contents(),
308 web_contents()->GetNativeView()); 308 web_contents()->GetNativeView());
309 popup_controller_->Show(true /* display_password */); 309 popup_controller_->Show(true /* display_password */);
310 #endif // #if defined(USE_AURA) 310 #endif // defined(USE_AURA) || defined(OS_MACOSX)
311 } 311 }
312 312
313 void ChromePasswordManagerClient::ShowPasswordEditingPopup( 313 void ChromePasswordManagerClient::ShowPasswordEditingPopup(
314 const gfx::RectF& bounds, 314 const gfx::RectF& bounds,
315 const autofill::PasswordForm& form) { 315 const autofill::PasswordForm& form) {
316 // Only implemented for Aura right now.
317 #if defined(USE_AURA)
318 gfx::RectF element_bounds_in_screen_space = GetBoundsInScreenSpace(bounds); 316 gfx::RectF element_bounds_in_screen_space = GetBoundsInScreenSpace(bounds);
319 317 // Not yet implemented on other platforms.
318 #if defined(USE_AURA) || defined(OS_MACOSX)
320 popup_controller_ = 319 popup_controller_ =
321 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate( 320 autofill::PasswordGenerationPopupControllerImpl::GetOrCreate(
322 popup_controller_, 321 popup_controller_,
323 element_bounds_in_screen_space, 322 element_bounds_in_screen_space,
324 form, 323 form,
325 0, // Unspecified max length. 324 0, // Unspecified max length.
326 driver_.GetPasswordManager(), 325 driver_.GetPasswordManager(),
327 observer_, 326 observer_,
328 web_contents(), 327 web_contents(),
329 web_contents()->GetNativeView()); 328 web_contents()->GetNativeView());
330 popup_controller_->Show(false /* display_password */); 329 popup_controller_->Show(false /* display_password */);
331 #endif // #if defined(USE_AURA) 330 #endif // defined(USE_AURA) || defined(OS_MACOSX)
332 } 331 }
333 332
334 void ChromePasswordManagerClient::CommitFillPasswordForm( 333 void ChromePasswordManagerClient::CommitFillPasswordForm(
335 autofill::PasswordFormFillData* data) { 334 autofill::PasswordFormFillData* data) {
336 driver_.FillPasswordForm(*data); 335 driver_.FillPasswordForm(*data);
337 } 336 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_popup_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698