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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model.cc

Issue 1311833004: [Password Manager] Implement ShouldShowMultipleAccountUpdateUI in ManagePasswordUIController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove check Created 5 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/manage_passwords_ui_controller.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 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/ui/passwords/manage_passwords_bubble_model.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/password_manager/password_store_factory.h" 9 #include "chrome/browser/password_manager/password_store_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 Profile* ManagePasswordsBubbleModel::GetProfile() const { 337 Profile* ManagePasswordsBubbleModel::GetProfile() const {
338 return GetProfileFromWebContents(web_contents()); 338 return GetProfileFromWebContents(web_contents());
339 } 339 }
340 340
341 bool ManagePasswordsBubbleModel::IsNewUIActive() const { 341 bool ManagePasswordsBubbleModel::IsNewUIActive() const {
342 return base::CommandLine::ForCurrentProcess()->HasSwitch( 342 return base::CommandLine::ForCurrentProcess()->HasSwitch(
343 switches::kEnableCredentialManagerAPI); 343 switches::kEnableCredentialManagerAPI);
344 } 344 }
345 345
346 bool ManagePasswordsBubbleModel::ShouldShowMultipleAccountUpdateUI() const { 346 bool ManagePasswordsBubbleModel::ShouldShowMultipleAccountUpdateUI() const {
347 return state_ == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE && 347 ManagePasswordsUIController* controller =
348 local_credentials_.size() > 1 && !password_overridden_; 348 ManagePasswordsUIController::FromWebContents(web_contents());
349 return controller->ShouldShowMultipleAccountUpdateUI();
349 } 350 }
350 351
351 // static 352 // static
352 int ManagePasswordsBubbleModel::UsernameFieldWidth() { 353 int ManagePasswordsBubbleModel::UsernameFieldWidth() {
353 return GetFieldWidth(USERNAME_FIELD); 354 return GetFieldWidth(USERNAME_FIELD);
354 } 355 }
355 356
356 // static 357 // static
357 int ManagePasswordsBubbleModel::PasswordFieldWidth() { 358 int ManagePasswordsBubbleModel::PasswordFieldWidth() {
358 return GetFieldWidth(PASSWORD_FIELD); 359 return GetFieldWidth(PASSWORD_FIELD);
(...skipping 29 matching lines...) Expand all
388 return NO_UPDATE_SUBMISSION; 389 return NO_UPDATE_SUBMISSION;
389 } 390 }
390 if (state_ != password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) 391 if (state_ != password_manager::ui::PENDING_PASSWORD_UPDATE_STATE)
391 return NO_UPDATE_SUBMISSION; 392 return NO_UPDATE_SUBMISSION;
392 if (password_overridden_) 393 if (password_overridden_)
393 return update_events[3][behavior]; 394 return update_events[3][behavior];
394 if (ShouldShowMultipleAccountUpdateUI()) 395 if (ShouldShowMultipleAccountUpdateUI())
395 return update_events[2][behavior]; 396 return update_events[2][behavior];
396 return update_events[1][behavior]; 397 return update_events[1][behavior];
397 } 398 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/passwords/manage_passwords_ui_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698