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

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

Issue 246393004: Password bubble: Introduce a command to open the bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
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 aa99be4b8b9ae00f395a1a058e661f03bbad2e92..8d34e9bcc7ac1f3982058cfc9831e03fe90d0df5 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h"
+#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/command_updater.h"
#include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h"
#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
#include "grit/generated_resources.h"
@@ -12,8 +14,10 @@
#include "ui/base/resource/resource_bundle.h"
ManagePasswordsIconView::ManagePasswordsIconView(
- LocationBarView::Delegate* location_bar_delegate)
- : location_bar_delegate_(location_bar_delegate) {
+ LocationBarView::Delegate* location_bar_delegate,
+ CommandUpdater* command_updater)
+ : location_bar_delegate_(location_bar_delegate),
+ command_updater_(command_updater) {
SetAccessibilityFocusable(true);
Update(NULL);
LocationBarView::InitTouchableLocationBarChildView(this);
@@ -46,9 +50,7 @@ void ManagePasswordsIconView::ShowBubbleIfNeeded(
manage_passwords_bubble_needs_showing() &&
visible() &&
!ManagePasswordsBubbleView::IsShowing()) {
- ManagePasswordsBubbleView::ShowBubble(
- location_bar_delegate_->GetWebContents(),
- ManagePasswordsBubbleView::AUTOMATIC);
+ command_updater_->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE);
manage_passwords_bubble_ui_controller->OnBubbleShown();
}
}
@@ -69,9 +71,7 @@ bool ManagePasswordsIconView::GetTooltipText(const gfx::Point& p,
void ManagePasswordsIconView::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP) {
- ManagePasswordsBubbleView::ShowBubble(
- location_bar_delegate_->GetWebContents(),
- ManagePasswordsBubbleView::USER_ACTION);
+ command_updater_->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE);
event->SetHandled();
}
}
@@ -83,8 +83,6 @@ bool ManagePasswordsIconView::OnMousePressed(const ui::MouseEvent& event) {
void ManagePasswordsIconView::OnMouseReleased(const ui::MouseEvent& event) {
if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) {
- ManagePasswordsBubbleView::ShowBubble(
- location_bar_delegate_->GetWebContents(),
- ManagePasswordsBubbleView::USER_ACTION);
+ command_updater_->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE);
}
}

Powered by Google App Engine
This is Rietveld 408576698