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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc

Issue 419263002: Add ManagePasswordsDecoration and unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude resource IDs on Android Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/passwords/manage_passwords_icon_view.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
index 4ab0eaccaef7eb50ea0bd7767a94b7dcdf443e81..58cef816fe33113aa4d25e0485295069dd52c4de 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
@@ -10,15 +10,11 @@
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
#include "components/password_manager/core/common/password_manager_ui.h"
-#include "grit/generated_resources.h"
-#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
ManagePasswordsIconView::ManagePasswordsIconView(CommandUpdater* updater)
- : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE),
- icon_id_(0),
- tooltip_text_id_(0) {
+ : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE) {
set_id(VIEW_ID_MANAGE_PASSWORDS_ICON_BUTTON);
SetAccessibilityFocusable(true);
UpdateVisibleUI();
@@ -27,28 +23,13 @@ ManagePasswordsIconView::ManagePasswordsIconView(CommandUpdater* updater)
ManagePasswordsIconView::~ManagePasswordsIconView() {}
void ManagePasswordsIconView::UpdateVisibleUI() {
- // If the icon is inactive: clear out it's image and tooltip, hide the icon,
- // close any active bubble, and exit early.
if (state() == password_manager::ui::INACTIVE_STATE) {
- icon_id_ = 0;
- tooltip_text_id_ = 0;
-
SetVisible(false);
if (ManagePasswordsBubbleView::IsShowing())
ManagePasswordsBubbleView::CloseBubble();
return;
}
- // Otherwise, start with the correct values for MANAGE_STATE, and adjust
- // things accordingly if we're either in BLACKLIST_STATE or PENDING_STATE.
- icon_id_ = active() ? IDR_SAVE_PASSWORD_ACTIVE : IDR_SAVE_PASSWORD_INACTIVE;
- tooltip_text_id_ = IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE;
- if (state() == password_manager::ui::BLACKLIST_STATE)
- icon_id_ = active() ? IDR_SAVE_PASSWORD_DISABLED_ACTIVE
- : IDR_SAVE_PASSWORD_DISABLED_INACTIVE;
- else if (password_manager::ui::IsPendingState(state()))
- tooltip_text_id_ = IDS_PASSWORD_MANAGER_TOOLTIP_SAVE;
-
SetVisible(true);
SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(icon_id_));
SetTooltipText(l10n_util::GetStringUTF16(tooltip_text_id_));
« no previous file with comments | « chrome/browser/ui/views/passwords/manage_passwords_icon_view.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698