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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 DCHECK(state() == password_manager::ui::PENDING_PASSWORD_STATE || | 345 DCHECK(state() == password_manager::ui::PENDING_PASSWORD_STATE || |
346 state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE || | 346 state() == password_manager::ui::PENDING_PASSWORD_UPDATE_STATE || |
347 state() == password_manager::ui::CONFIRMATION_STATE) | 347 state() == password_manager::ui::CONFIRMATION_STATE) |
348 << state(); | 348 << state(); |
349 password_manager::PasswordFormManager* form_manager = | 349 password_manager::PasswordFormManager* form_manager = |
350 passwords_data_.form_manager(); | 350 passwords_data_.form_manager(); |
351 DCHECK(form_manager); | 351 DCHECK(form_manager); |
352 return form_manager->pending_credentials(); | 352 return form_manager->pending_credentials(); |
353 } | 353 } |
354 | 354 |
355 bool ManagePasswordsUIController::PasswordOverriden() const { | |
356 password_manager::PasswordFormManager* form_manager = | |
vabr (Chromium)
2015/08/17 13:21:46
nit: A const pointer should suffice.
dvadym
2015/08/17 14:25:34
Done.
| |
357 passwords_data_.form_manager(); | |
358 return form_manager ? form_manager->password_overriden() : false; | |
359 } | |
360 | |
355 void ManagePasswordsUIController::UpdateIconAndBubbleState( | 361 void ManagePasswordsUIController::UpdateIconAndBubbleState( |
356 ManagePasswordsIcon* icon) { | 362 ManagePasswordsIcon* icon) { |
357 if (should_pop_up_bubble_) { | 363 if (should_pop_up_bubble_) { |
358 // We must display the icon before showing the bubble, as the bubble would | 364 // We must display the icon before showing the bubble, as the bubble would |
359 // be otherwise unanchored. | 365 // be otherwise unanchored. |
360 icon->SetState(state()); | 366 icon->SetState(state()); |
361 ShowBubbleWithoutUserInteraction(); | 367 ShowBubbleWithoutUserInteraction(); |
362 } else { | 368 } else { |
363 icon->SetState(state()); | 369 icon->SetState(state()); |
364 } | 370 } |
(...skipping 23 matching lines...) Expand all Loading... | |
388 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 394 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
389 #endif | 395 #endif |
390 } | 396 } |
391 | 397 |
392 void ManagePasswordsUIController::WebContentsDestroyed() { | 398 void ManagePasswordsUIController::WebContentsDestroyed() { |
393 password_manager::PasswordStore* password_store = | 399 password_manager::PasswordStore* password_store = |
394 GetPasswordStore(web_contents()); | 400 GetPasswordStore(web_contents()); |
395 if (password_store) | 401 if (password_store) |
396 password_store->RemoveObserver(this); | 402 password_store->RemoveObserver(this); |
397 } | 403 } |
OLD | NEW |