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

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

Issue 1402363013: Update location bar bubble/icon behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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
Index: chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
index aa847dbeb442e796eed455fff961c9cc9176d5a8..56e6d94d516e9a2c81726774045c7925e3867d8a 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
@@ -23,16 +23,11 @@ ManagePasswordsIconViews::ManagePasswordsIconViews(CommandUpdater* updater)
ManagePasswordsIconViews::~ManagePasswordsIconViews() {}
-void ManagePasswordsIconViews::SetActive(bool active) {
- SetActiveInternal(active);
-}
-
void ManagePasswordsIconViews::SetState(password_manager::ui::State state) {
if (state_ == state)
return;
// If there is an opened bubble for the current icon it should go away.
- if (active())
- ManagePasswordsBubbleView::CloseBubble();
+ ManagePasswordsBubbleView::CloseBubble();
state_ = state;
UpdateUiForState();
}
@@ -61,8 +56,7 @@ void ManagePasswordsIconViews::OnExecuting(
bool ManagePasswordsIconViews::OnMousePressed(const ui::MouseEvent& event) {
bool result = BubbleIconView::OnMousePressed(event);
- if (IsBubbleShowing())
- ManagePasswordsBubbleView::CloseBubble();
+ ManagePasswordsBubbleView::CloseBubble();
return result;
}
@@ -72,8 +66,8 @@ bool ManagePasswordsIconViews::OnKeyPressed(const ui::KeyEvent& event) {
// button.
if (event.key_code() == ui::VKEY_SPACE)
return true;
- if (event.key_code() == ui::VKEY_RETURN && active()) {
- // If the icon is active, it should transfer its focus to the bubble.
+ if (event.key_code() == ui::VKEY_RETURN && IsBubbleShowing()) {
+ // If the bubble's open, the icon should transfer its focus to the bubble.
// If it still somehow got this key event, the bubble shouldn't be reopened.
return true;
}
@@ -90,6 +84,6 @@ gfx::VectorIconId ManagePasswordsIconViews::GetVectorIcon() const {
void ManagePasswordsIconViews::AboutToRequestFocusFromTabTraversal(
bool reverse) {
- if (active())
+ if (IsBubbleShowing())
ManagePasswordsBubbleView::ActivateBubble();
}
« no previous file with comments | « chrome/browser/ui/views/passwords/manage_passwords_icon_views.h ('k') | chrome/browser/ui/views/tab_dialogs_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698